From c3c0539736a86d3456f7c7dd2adada2fa96a28af Mon Sep 17 00:00:00 2001 From: Daniel Saukel Date: Wed, 12 Jun 2019 17:16:43 +0200 Subject: [PATCH] Vignette --- core/pom.xml | 6 ++++++ .../erethon/dungeonsxl/reward/RewardListener.java | 9 ++++++--- dist/pom.xml | 15 +++++++++++---- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index 8b6d8198..8e621a29 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -46,6 +46,12 @@ 6.0 compile + + de.erethon.vignette + vignette-dist + 1.0-SNAPSHOT + compile + io.github.dre2n commandsxl diff --git a/core/src/main/java/de/erethon/dungeonsxl/reward/RewardListener.java b/core/src/main/java/de/erethon/dungeonsxl/reward/RewardListener.java index bcb9d34e..686623b4 100644 --- a/core/src/main/java/de/erethon/dungeonsxl/reward/RewardListener.java +++ b/core/src/main/java/de/erethon/dungeonsxl/reward/RewardListener.java @@ -17,7 +17,6 @@ package de.erethon.dungeonsxl.reward; import de.erethon.caliburn.item.VanillaItem; -import de.erethon.commons.gui.PageGUI; import de.erethon.dungeonsxl.DungeonsXL; import de.erethon.dungeonsxl.config.DMessage; import de.erethon.dungeonsxl.player.DGlobalPlayer; @@ -25,6 +24,8 @@ import de.erethon.dungeonsxl.player.DPermission; import de.erethon.dungeonsxl.world.DEditWorld; import de.erethon.dungeonsxl.world.DGameWorld; import de.erethon.dungeonsxl.world.block.RewardChest; +import de.erethon.vignette.api.PaginatedInventoryGUI; +import de.erethon.vignette.api.component.InventoryButton; import org.bukkit.World; import org.bukkit.block.Block; import org.bukkit.block.Chest; @@ -121,10 +122,12 @@ public class RewardListener implements Listener { if (dPlayer.hasRewardItemsLeft() && !VanillaItem.NETHER_PORTAL.is(block.getRelative(0, 1, 0)) && !VanillaItem.NETHER_PORTAL.is(block.getRelative(0, -1, 0)) && !VanillaItem.NETHER_PORTAL.is(block.getRelative(1, 0, 0)) && !VanillaItem.NETHER_PORTAL.is(block.getRelative(-1, 0, 0)) && !VanillaItem.NETHER_PORTAL.is(block.getRelative(0, 0, 1)) && !VanillaItem.NETHER_PORTAL.is(block.getRelative(0, 0, -1))) { - PageGUI lootInventory = new PageGUI(DMessage.PLAYER_TREASURES.getMessage(), true); + PaginatedInventoryGUI lootInventory = new PaginatedInventoryGUI(DMessage.PLAYER_TREASURES.getMessage()); for (ItemStack item : dPlayer.getRewardItems()) { if (item != null) { - lootInventory.addButton(item); + InventoryButton button = new InventoryButton(item); + button.setStealable(true); + lootInventory.add(button); } } lootInventory.open(player); diff --git a/dist/pom.xml b/dist/pom.xml index 6494ddef..e6529f12 100644 --- a/dist/pom.xml +++ b/dist/pom.xml @@ -26,7 +26,8 @@ de.erethon:caliburn - de.erethon:commons + de.erethon.commons:commons-dist + de.erethon.vignette:vignette-dist de.erethon.dungeonsxl:* @@ -54,9 +55,15 @@ 0.5.4 - de.erethon - commons - 5.1.5 + de.erethon.vignette + vignette-dist + 1.0-SNAPSHOT + compile + + + de.erethon.commons + commons-dist + 6.0