mirror of
https://github.com/JEFF-Media-GbR/ChestSort.git
synced 2024-12-02 23:53:21 +01:00
Bug related to the AdvancedChests hook was fixed
This commit is contained in:
parent
c4f6f37c3d
commit
f9003a424f
2
pom.xml
2
pom.xml
@ -255,7 +255,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.DeadSilenceIV</groupId>
|
<groupId>com.github.DeadSilenceIV</groupId>
|
||||||
<artifactId>AdvancedChestsAPI</artifactId>
|
<artifactId>AdvancedChestsAPI</artifactId>
|
||||||
<version>2.2</version>
|
<version>2.4</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ import org.bukkit.inventory.Inventory;
|
|||||||
import us.lynuxcraft.deadsilenceiv.advancedchests.AdvancedChestsAPI;
|
import us.lynuxcraft.deadsilenceiv.advancedchests.AdvancedChestsAPI;
|
||||||
import us.lynuxcraft.deadsilenceiv.advancedchests.chest.AdvancedChest;
|
import us.lynuxcraft.deadsilenceiv.advancedchests.chest.AdvancedChest;
|
||||||
import us.lynuxcraft.deadsilenceiv.advancedchests.chest.gui.page.ChestPage;
|
import us.lynuxcraft.deadsilenceiv.advancedchests.chest.gui.page.ChestPage;
|
||||||
|
import us.lynuxcraft.deadsilenceiv.advancedchests.utils.inventory.InteractiveInventory;
|
||||||
|
|
||||||
public class AdvancedChestsHook {
|
public class AdvancedChestsHook {
|
||||||
|
|
||||||
@ -31,12 +32,13 @@ public class AdvancedChestsHook {
|
|||||||
|
|
||||||
public boolean handleAChestSortingIfPresent(Inventory inventory){
|
public boolean handleAChestSortingIfPresent(Inventory inventory){
|
||||||
if(!plugin.isHookAdvancedChests())return false;
|
if(!plugin.isHookAdvancedChests())return false;
|
||||||
AdvancedChest chest = AdvancedChestsAPI.getInventoryManager().getAdvancedChest(inventory);
|
InteractiveInventory interactiveInventory = AdvancedChestsAPI.getInventoryManager().getInteractiveByBukkit(inventory);
|
||||||
if(chest != null){
|
if(interactiveInventory != null) {
|
||||||
|
if (interactiveInventory instanceof ChestPage) {
|
||||||
plugin.getOrganizer().sortInventory(inventory, 0, inventory.getSize() - 10);
|
plugin.getOrganizer().sortInventory(inventory, 0, inventory.getSize() - 10);
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
return false;
|
return true;
|
||||||
|
}else return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean handleAChestSortingIfPresent(Location location){
|
public boolean handleAChestSortingIfPresent(Location location){
|
||||||
|
Loading…
Reference in New Issue
Block a user