This repository was archived by the owner on Sep 9, 2024. It is now read-only.
File tree 3 files changed +10
-8
lines changed
src/main/java/io/github/puyodead1/rpbookgui
3 files changed +10
-8
lines changed Original file line number Diff line number Diff line change 5
5
<modelVersion >4.0.0</modelVersion >
6
6
<groupId >me.puyodead1</groupId >
7
7
<artifactId >RPBookGUI</artifactId >
8
- <version >2.9.9-RC2 </version >
8
+ <version >2.9.10 </version >
9
9
<name >RPBookGUI</name >
10
10
11
11
<repositories >
Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ public static Inventory settingsInventory() {
125
125
* @param ce
126
126
* @return inventory
127
127
*/
128
- public static Inventory successAndDestroyInventory (CustomEnchant ce ) {
128
+ public static Inventory successAndDestroyInventory (CustomEnchant ce , int level ) {
129
129
Inventory inv = Bukkit .createInventory (null , 45 ,
130
130
"Success & Destroy Configuration" );
131
131
// slot 10-12 - increase success
@@ -196,8 +196,7 @@ public static Inventory successAndDestroyInventory(CustomEnchant ce) {
196
196
197
197
inv .setItem (22 ,
198
198
CustomEnchants .getCustomEnchants ()
199
- .getRevealedItem (ce , EnchantConstructor .getEnchants ()
200
- .get (ce .getIdentifier ()).getEnchantLevel (), 0 ,
199
+ .getRevealedItem (ce , level , 0 ,
201
200
0 , true , true ));
202
201
203
202
inv .setItem (28 , rs1 );
Original file line number Diff line number Diff line change 2
2
3
3
import io .github .puyodead1 .rpbookgui .utils .UMaterial ;
4
4
import me .randomhashtags .randompackage .RandomPackageAPI ;
5
+ import me .randomhashtags .randompackage .addon .CustomEnchant ;
6
+ import me .randomhashtags .randompackage .api .CustomEnchants ;
7
+ import org .bukkit .Bukkit ;
5
8
import org .bukkit .Material ;
6
9
import org .bukkit .entity .Player ;
7
10
import org .bukkit .event .EventHandler ;
@@ -34,15 +37,15 @@ public void clickEvent(InventoryClickEvent e) {
34
37
35
38
if (item .getType ()
36
39
.equals (UMaterial .match ("BOOK" ).getMaterial ())) {
37
- // Note: there was the old enchant constructor removal here,
38
- // but
39
- // doesnt seem needed as there is only one enchant now
40
40
if (RPBookGUI .getPlugin .getConfig ().getBoolean (
41
41
"settings.use success destroy configuration" )) {
42
42
player .getOpenInventory ().close ();
43
+ final CustomEnchant ce = RandomPackageAPI .INSTANCE .valueOfCustomEnchant (item );
44
+ final int level = CustomEnchants .getCustomEnchants ().getEnchantmentLevel (item .getItemMeta ().getDisplayName ());
43
45
player .openInventory (
44
46
Inventories .successAndDestroyInventory (
45
- RandomPackageAPI .INSTANCE .valueOfCustomEnchant (item )));
47
+ ce , level ));
48
+
46
49
} else {
47
50
player .getInventory ().addItem (item );
48
51
if (!RPBookGUI .getPlugin .getConfig ()
You can’t perform that action at this time.
0 commit comments