Drop Depricated 1.13 SIGN object.

Update to 1.7 BentoBox.
This commit is contained in:
BONNe 2019-09-08 20:15:30 +03:00
parent 4e6d37cd90
commit 449890def5
8 changed files with 17 additions and 25 deletions

View File

@ -36,7 +36,7 @@
<powermock.version>1.7.4</powermock.version> <powermock.version>1.7.4</powermock.version>
<!-- More visible way how to change dependency versions --> <!-- More visible way how to change dependency versions -->
<spigot.version>1.14.4-R0.1-SNAPSHOT</spigot.version> <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> <level.version>1.6.0</level.version>
<vault.version>1.7</vault.version> <vault.version>1.7</vault.version>
<!-- Revision variable removes warning about dynamic version --> <!-- Revision variable removes warning about dynamic version -->

View File

@ -1,7 +1,6 @@
package world.bentobox.challenges; package world.bentobox.challenges;
import org.bukkit.Bukkit;
import org.bukkit.Material; import org.bukkit.Material;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -100,14 +99,6 @@ public class ChallengesAddon extends Addon {
new Flag.Builder("CHALLENGES_ISLAND_PROTECTION", Material.COMMAND_BLOCK).defaultRank(RanksManager.VISITOR_RANK).build(); 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 // Section: Methods
// --------------------------------------------------------------------- // ---------------------------------------------------------------------

View File

@ -273,7 +273,7 @@ public abstract class CommonGUI
{ {
name = this.user.getTranslation("challenges.gui.buttons.next"); name = this.user.getTranslation("challenges.gui.buttons.next");
description = Collections.emptyList(); description = Collections.emptyList();
icon = new ItemStack(ChallengesAddon.SIGN_MATERIAL); icon = new ItemStack(Material.OAK_SIGN);
clickHandler = (panel, user, clickType, slot) -> { clickHandler = (panel, user, clickType, slot) -> {
this.pageIndex++; this.pageIndex++;
this.build(); this.build();
@ -286,7 +286,7 @@ public abstract class CommonGUI
{ {
name = this.user.getTranslation("challenges.gui.buttons.previous"); name = this.user.getTranslation("challenges.gui.buttons.previous");
description = Collections.emptyList(); description = Collections.emptyList();
icon = new ItemStack(ChallengesAddon.SIGN_MATERIAL); icon = new ItemStack(Material.OAK_SIGN);
clickHandler = (panel, user, clickType, slot) -> { clickHandler = (panel, user, clickType, slot) -> {
this.pageIndex--; this.pageIndex--;
this.build(); this.build();

View File

@ -455,7 +455,7 @@ public class EditSettingsGUI extends CommonGUI
this.user.getTranslation("challenges.gui.descriptions.enabled") : this.user.getTranslation("challenges.gui.descriptions.enabled") :
this.user.getTranslation("challenges.gui.descriptions.disabled"))); this.user.getTranslation("challenges.gui.descriptions.disabled")));
name = this.user.getTranslation("challenges.gui.buttons.admin.title-enable"); 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) -> { clickHandler = (panel, user1, clickType, i) -> {
this.settings.setShowCompletionTitle(!this.settings.isShowCompletionTitle()); this.settings.setShowCompletionTitle(!this.settings.isShowCompletionTitle());

View File

@ -2,6 +2,7 @@ package world.bentobox.challenges.panel.user;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import java.util.List; import java.util.List;
@ -167,7 +168,7 @@ public class ChallengesGUI extends CommonGUI
if (this.freeChallengeIndex > 0) if (this.freeChallengeIndex > 0)
{ {
panelBuilder.item(index++, new PanelItemBuilder(). panelBuilder.item(index++, new PanelItemBuilder().
icon(ChallengesAddon.SIGN_MATERIAL). icon(Material.OAK_SIGN).
name(this.user.getTranslation("challenges.gui.buttons.previous")). name(this.user.getTranslation("challenges.gui.buttons.previous")).
clickHandler((panel, user1, clickType, slot) -> { clickHandler((panel, user1, clickType, slot) -> {
this.freeChallengeIndex--; this.freeChallengeIndex--;
@ -191,7 +192,7 @@ public class ChallengesGUI extends CommonGUI
else if (currentIndex < freeChallengesCount) else if (currentIndex < freeChallengesCount)
{ {
panelBuilder.item(index, new PanelItemBuilder(). panelBuilder.item(index, new PanelItemBuilder().
icon(ChallengesAddon.SIGN_MATERIAL). icon(Material.OAK_SIGN).
name(this.user.getTranslation("challenges.gui.buttons.next")). name(this.user.getTranslation("challenges.gui.buttons.next")).
clickHandler((panel, user1, clickType, slot) -> { clickHandler((panel, user1, clickType, slot) -> {
this.freeChallengeIndex++; this.freeChallengeIndex++;
@ -243,7 +244,7 @@ public class ChallengesGUI extends CommonGUI
if (this.pageIndex > 0) if (this.pageIndex > 0)
{ {
panelBuilder.item(index++, new PanelItemBuilder(). panelBuilder.item(index++, new PanelItemBuilder().
icon(ChallengesAddon.SIGN_MATERIAL). icon(Material.OAK_SIGN).
name(this.user.getTranslation("challenges.gui.buttons.previous")). name(this.user.getTranslation("challenges.gui.buttons.previous")).
clickHandler((panel, user1, clickType, slot) -> { clickHandler((panel, user1, clickType, slot) -> {
this.pageIndex--; this.pageIndex--;
@ -267,7 +268,7 @@ public class ChallengesGUI extends CommonGUI
else if (currentIndex < challengesCount) else if (currentIndex < challengesCount)
{ {
panelBuilder.item(index, new PanelItemBuilder(). panelBuilder.item(index, new PanelItemBuilder().
icon(ChallengesAddon.SIGN_MATERIAL). icon(Material.OAK_SIGN).
name(this.user.getTranslation("challenges.gui.buttons.next")). name(this.user.getTranslation("challenges.gui.buttons.next")).
clickHandler((panel, user1, clickType, slot) -> { clickHandler((panel, user1, clickType, slot) -> {
this.pageIndex++; this.pageIndex++;
@ -304,7 +305,7 @@ public class ChallengesGUI extends CommonGUI
if (this.levelIndex > 0) if (this.levelIndex > 0)
{ {
panelBuilder.item(index++, new PanelItemBuilder(). panelBuilder.item(index++, new PanelItemBuilder().
icon(ChallengesAddon.SIGN_MATERIAL). icon(Material.OAK_SIGN).
name(this.user.getTranslation("challenges.gui.buttons.previous")). name(this.user.getTranslation("challenges.gui.buttons.previous")).
clickHandler((panel, user1, clickType, slot) -> { clickHandler((panel, user1, clickType, slot) -> {
this.levelIndex--; this.levelIndex--;
@ -328,7 +329,7 @@ public class ChallengesGUI extends CommonGUI
else if (currentIndex < levelCounts) else if (currentIndex < levelCounts)
{ {
panelBuilder.item(index, new PanelItemBuilder(). panelBuilder.item(index, new PanelItemBuilder().
icon(ChallengesAddon.SIGN_MATERIAL). icon(Material.OAK_SIGN).
name(this.user.getTranslation("challenges.gui.buttons.next")). name(this.user.getTranslation("challenges.gui.buttons.next")).
clickHandler((panel, user1, clickType, slot) -> { clickHandler((panel, user1, clickType, slot) -> {
this.levelIndex++; this.levelIndex++;

View File

@ -145,7 +145,7 @@ public class SelectBlocksGUI
panelBuilder.item(18, panelBuilder.item(18,
new PanelItemBuilder(). new PanelItemBuilder().
icon(ChallengesAddon.SIGN_MATERIAL). icon(Material.OAK_SIGN).
name(this.user.getTranslation("challenges.gui.buttons.previous")). name(this.user.getTranslation("challenges.gui.buttons.previous")).
clickHandler((panel, user1, clickType, slot) -> { clickHandler((panel, user1, clickType, slot) -> {
this.build(correctPage - 1); this.build(correctPage - 1);
@ -154,7 +154,7 @@ public class SelectBlocksGUI
panelBuilder.item(26, panelBuilder.item(26,
new PanelItemBuilder(). new PanelItemBuilder().
icon(ChallengesAddon.SIGN_MATERIAL). icon(Material.OAK_SIGN).
name(this.user.getTranslation("challenges.gui.buttons.next")). name(this.user.getTranslation("challenges.gui.buttons.next")).
clickHandler((panel, user1, clickType, slot) -> { clickHandler((panel, user1, clickType, slot) -> {
this.build(correctPage + 1); this.build(correctPage + 1);

View File

@ -76,7 +76,7 @@ public class SelectChallengeGUI
panelBuilder.item(18, panelBuilder.item(18,
new PanelItemBuilder(). new PanelItemBuilder().
icon(ChallengesAddon.SIGN_MATERIAL). icon(Material.OAK_SIGN).
name(this.user.getTranslation("challenges.gui.buttons.previous")). name(this.user.getTranslation("challenges.gui.buttons.previous")).
clickHandler((panel, user1, clickType, slot) -> { clickHandler((panel, user1, clickType, slot) -> {
this.build(correctPage - 1); this.build(correctPage - 1);
@ -85,7 +85,7 @@ public class SelectChallengeGUI
panelBuilder.item(26, panelBuilder.item(26,
new PanelItemBuilder(). new PanelItemBuilder().
icon(ChallengesAddon.SIGN_MATERIAL). icon(Material.OAK_SIGN).
name(this.user.getTranslation("challenges.gui.buttons.next")). name(this.user.getTranslation("challenges.gui.buttons.next")).
clickHandler((panel, user1, clickType, slot) -> { clickHandler((panel, user1, clickType, slot) -> {
this.build(correctPage + 1); this.build(correctPage + 1);

View File

@ -115,7 +115,7 @@ public class SelectEntityGUI
panelBuilder.item(18, panelBuilder.item(18,
new PanelItemBuilder(). new PanelItemBuilder().
icon(ChallengesAddon.SIGN_MATERIAL). icon(Material.OAK_SIGN).
name(this.user.getTranslation("challenges.gui.buttons.previous")). name(this.user.getTranslation("challenges.gui.buttons.previous")).
clickHandler((panel, user1, clickType, slot) -> { clickHandler((panel, user1, clickType, slot) -> {
this.build(correctPage - 1); this.build(correctPage - 1);
@ -124,7 +124,7 @@ public class SelectEntityGUI
panelBuilder.item(26, panelBuilder.item(26,
new PanelItemBuilder(). new PanelItemBuilder().
icon(ChallengesAddon.SIGN_MATERIAL). icon(Material.OAK_SIGN).
name(this.user.getTranslation("challenges.gui.buttons.next")). name(this.user.getTranslation("challenges.gui.buttons.next")).
clickHandler((panel, user1, clickType, slot) -> { clickHandler((panel, user1, clickType, slot) -> {
this.build(correctPage + 1); this.build(correctPage + 1);