Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Commit

Permalink
2.9.8-hf1 - Fixes and Updates
Browse files Browse the repository at this point in the history
- Update RandomPackage to 16.5.1
- Fix material issues on legacy versions
- Fix books from having 100+ success/destroy
  • Loading branch information
Puyodead1 committed Nov 4, 2019
1 parent 16500aa commit 95a7dbe
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 23 deletions.
8 changes: 2 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>me.puyodead1</groupId>
<artifactId>RPBookGUI</artifactId>
<version>2.9.8</version>
<version>2.9.8-h1</version>
<name>RPBookGUI</name>
<repositories>
<repository>
Expand All @@ -16,10 +16,6 @@
<id>bungeecord-repo</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
<repository>
<id>github</id>
<url>https://github.com/Puyodead1/maven/raw/repository/</url>
</repository>
</repositories>

<dependencies>
Expand All @@ -32,7 +28,7 @@
<dependency>
<groupId>me.randomhashtags</groupId>
<artifactId>randompackage</artifactId>
<version>16.5.0</version>
<version>16.5.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,14 +336,14 @@ public void InventoryClickEvent(InventoryClickEvent e) {
final int newAmount = (currentSuccess + amount);
ItemStack eb = CustomEnchants.getCustomEnchants().getRevealedItem(ce,
EnchantConstructor.getEnchants().get(ce.getIdentifier()).getEnchantLevel(),
newAmount > 0 ? newAmount : currentSuccess, currentDestroy, true, true);
newAmount > 0 && newAmount <= 100 ? newAmount : currentSuccess, currentDestroy, true, true);
e.getInventory().setItem(22, eb);
player.updateInventory();
} else if (incrementType.equals("-")) {
final int newAmount = (currentSuccess - amount);
ItemStack eb = CustomEnchants.getCustomEnchants().getRevealedItem(ce,
EnchantConstructor.getEnchants().get(ce.getIdentifier()).getEnchantLevel(),
newAmount > 0 ? newAmount : currentSuccess, currentDestroy, true, true);
newAmount > 0 && newAmount <= 100 ? newAmount : currentSuccess, currentDestroy, true, true);
e.getInventory().setItem(22, eb);
player.updateInventory();
}
Expand All @@ -352,14 +352,14 @@ public void InventoryClickEvent(InventoryClickEvent e) {
final int newAmount = (currentDestroy + amount);
ItemStack eb = CustomEnchants.getCustomEnchants().getRevealedItem(ce,
EnchantConstructor.getEnchants().get(ce.getIdentifier()).getEnchantLevel(),
currentSuccess, newAmount > 0 ? newAmount : currentDestroy, true, true);
currentSuccess, newAmount > 0 && newAmount <= 100 ? newAmount : currentDestroy, true, true);
e.getInventory().setItem(22, eb);
player.updateInventory();
} else if (incrementType.equals("-")) {
final int newAmount = (currentDestroy - amount);
ItemStack eb = CustomEnchants.getCustomEnchants().getRevealedItem(ce,
EnchantConstructor.getEnchants().get(ce.getIdentifier()).getEnchantLevel(),
currentSuccess, newAmount > 0 ? newAmount : currentDestroy, true, true);
currentSuccess, newAmount > 0 && newAmount <= 100 ? newAmount : currentDestroy, true, true);
e.getInventory().setItem(22, eb);
player.updateInventory();
}
Expand Down
25 changes: 13 additions & 12 deletions src/main/java/io/github/puyodead1/rpbookgui/Inventories.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import me.randomhashtags.randompackage.addon.EnchantRarity;
import me.randomhashtags.randompackage.api.CustomEnchants;
import me.randomhashtags.randompackage.util.RPStorage;
import me.randomhashtags.randompackage.util.universal.UMaterial;

public class Inventories {

Expand Down Expand Up @@ -348,31 +349,31 @@ public static Inventory SuccessDestroySelection(ItemStack book) {
// slot 22 - book

// Success controls
ItemStack as1 = new ItemBuilder(Material.GREEN_WOOL).setName(RPBookGUIUtils.ChatColor("&a+1 Success"))
ItemStack as1 = new ItemBuilder(UMaterial.match("GREEN_WOOL").getItemStack()).setName(RPBookGUIUtils.ChatColor("&a+1 Success"))
.toItemStack();
ItemStack rs1 = new ItemBuilder(Material.RED_WOOL).setName(RPBookGUIUtils.ChatColor("&c-1 Success"))
ItemStack rs1 = new ItemBuilder(UMaterial.match("RED_WOOL").getItemStack()).setName(RPBookGUIUtils.ChatColor("&c-1 Success"))
.toItemStack();
ItemStack as5 = new ItemBuilder(Material.GREEN_WOOL).setName(RPBookGUIUtils.ChatColor("&a+5 Success"))
ItemStack as5 = new ItemBuilder(UMaterial.match("GREEN_WOOL").getItemStack()).setName(RPBookGUIUtils.ChatColor("&a+5 Success"))
.toItemStack();
ItemStack rs5 = new ItemBuilder(Material.RED_WOOL).setName(RPBookGUIUtils.ChatColor("&c-5 Success"))
ItemStack rs5 = new ItemBuilder(UMaterial.match("RED_WOOL").getItemStack()).setName(RPBookGUIUtils.ChatColor("&c-5 Success"))
.toItemStack();
ItemStack as10 = new ItemBuilder(Material.GREEN_WOOL).setName(RPBookGUIUtils.ChatColor("&a+10 Success"))
ItemStack as10 = new ItemBuilder(UMaterial.match("GREEN_WOOL").getItemStack()).setName(RPBookGUIUtils.ChatColor("&a+10 Success"))
.toItemStack();
ItemStack rs10 = new ItemBuilder(Material.RED_WOOL).setName(RPBookGUIUtils.ChatColor("&c-10 Success"))
ItemStack rs10 = new ItemBuilder(UMaterial.match("RED_WOOL").getItemStack()).setName(RPBookGUIUtils.ChatColor("&c-10 Success"))
.toItemStack();

// Destroy controls
ItemStack ad1 = new ItemBuilder(Material.GREEN_WOOL).setName(RPBookGUIUtils.ChatColor("&a+1 Destroy"))
ItemStack ad1 = new ItemBuilder(UMaterial.match("GREEN_WOOL").getItemStack()).setName(RPBookGUIUtils.ChatColor("&a+1 Destroy"))
.toItemStack();
ItemStack rd1 = new ItemBuilder(Material.RED_WOOL).setName(RPBookGUIUtils.ChatColor("&c-1 Destroy"))
ItemStack rd1 = new ItemBuilder(UMaterial.match("RED_WOOL").getItemStack()).setName(RPBookGUIUtils.ChatColor("&c-1 Destroy"))
.toItemStack();
ItemStack ad5 = new ItemBuilder(Material.GREEN_WOOL).setName(RPBookGUIUtils.ChatColor("&a+5 Destroy"))
ItemStack ad5 = new ItemBuilder(UMaterial.match("GREEN_WOOL").getItemStack()).setName(RPBookGUIUtils.ChatColor("&a+5 Destroy"))
.toItemStack();
ItemStack rd5 = new ItemBuilder(Material.RED_WOOL).setName(RPBookGUIUtils.ChatColor("&c-5 Destroy"))
ItemStack rd5 = new ItemBuilder(UMaterial.match("RED_WOOL").getItemStack()).setName(RPBookGUIUtils.ChatColor("&c-5 Destroy"))
.toItemStack();
ItemStack ad10 = new ItemBuilder(Material.GREEN_WOOL).setName(RPBookGUIUtils.ChatColor("&a+10 Destroy"))
ItemStack ad10 = new ItemBuilder(UMaterial.match("GREEN_WOOL").getItemStack()).setName(RPBookGUIUtils.ChatColor("&a+10 Destroy"))
.toItemStack();
ItemStack rd10 = new ItemBuilder(Material.RED_WOOL).setName(RPBookGUIUtils.ChatColor("&c-10 Destroy"))
ItemStack rd10 = new ItemBuilder(UMaterial.match("RED_WOOL").getItemStack()).setName(RPBookGUIUtils.ChatColor("&c-10 Destroy"))
.toItemStack();

inv.setItem(10, as1);
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: RPBookGUI
version: 2.9.8
version: 2.9.8-hf1
author: Puyodead1
main: io.github.puyodead1.rpbookgui.RPBookGUI
depend: [RandomPackage]
Expand Down

0 comments on commit 95a7dbe

Please sign in to comment.