Added back button to ItemEdition

(Also configured pom.xml to encode AltChar.java properly)
This commit is contained in:
ASangarin 2019-08-28 12:50:13 +01:00
parent a3b5420f58
commit 9464adee21
3 changed files with 13 additions and 3 deletions

View File

@ -11,6 +11,11 @@
<configuration>
<source>1.8</source>
<target>1.8</target>
<junitArtifactName>junit:junit</junitArtifactName>
<encoding>UTF-8</encoding>
<inputEncoding>UTF-8</inputEncoding>
<outputEncoding>UTF-8</outputEncoding>
<argLine>-ea -Dfile.encoding=UTF-8</argLine>
</configuration>
</plugin>
</plugins>
@ -218,5 +223,7 @@
<properties>
<downloadSources>false</downloadSources>
<downloadJavadocs>false</downloadJavadocs>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
</project>

View File

@ -83,7 +83,7 @@ public class ItemEdition extends EditionInventory {
previousMeta.setDisplayName(ChatColor.GREEN + "Previous Page");
previous.setItemMeta(previousMeta);
addEditionInventoryItems(inv, false);
addEditionInventoryItems(inv, true);
while (n < slots.length)
inv.setItem(slots[n++], glass);

View File

@ -11,6 +11,7 @@ import org.bukkit.inventory.ItemStack;
import net.Indyuce.mmoitems.MMOUtils;
import net.Indyuce.mmoitems.api.Type;
import net.Indyuce.mmoitems.api.util.AltChar;
import net.Indyuce.mmoitems.gui.ItemBrowser;
import net.Indyuce.mmoitems.gui.PluginInventory;
import net.Indyuce.mmoitems.gui.edition.AdvancedRecipeEdition;
import net.Indyuce.mmoitems.gui.edition.EditionInventory;
@ -43,8 +44,10 @@ public class GuiListener implements Listener {
Type type = ((EditionInventory) inventory).getItemType();
String id = ((EditionInventory) inventory).getItemId();
if (item.getItemMeta().getDisplayName().equals(ChatColor.GREEN + AltChar.rightArrow + " Back"))
new ItemEdition(player, type, id).open();
if (item.getItemMeta().getDisplayName().equals(ChatColor.GREEN + AltChar.rightArrow + " Back")) {
if(inventory instanceof ItemEdition) new ItemBrowser(player, type).open();
else new ItemEdition(player, type, id).open();
}
}
}