mirror of
https://github.com/JEFF-Media-GbR/ChestSort.git
synced 2025-02-18 13:21:29 +01:00
8.10.4 release
This commit is contained in:
parent
fa898f66f4
commit
73f361651f
@ -1,4 +1,7 @@
|
||||
# Changelog
|
||||
## 8.10.4
|
||||
- Fixed exception when sorting inventories in 1.8 because Inventory.getLocation() did not exist yet
|
||||
|
||||
## 8.10.3
|
||||
- Fixed exception when using the left-/right-click hotkey while using PaperMC instead of Spigot
|
||||
|
||||
|
2
pom.xml
2
pom.xml
@ -9,7 +9,7 @@
|
||||
<name>JeffChestSort</name>
|
||||
<url>https://www.chestsort.de</url>
|
||||
<description>Automatically sorts your chests!</description>
|
||||
<version>8.10.3</version>
|
||||
<version>8.10.4</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<properties>
|
||||
|
@ -387,16 +387,25 @@ public class ChestSortOrganizer {
|
||||
|
||||
// Sort an inventory only between startSlot and endSlot
|
||||
void sortInventory(Inventory inv, int startSlot, int endSlot) {
|
||||
|
||||
if(inv.getLocation() != null) {
|
||||
ChestSortEvent chestSortEvent = new ChestSortEvent(inv);
|
||||
chestSortEvent.loc = inv.getLocation();
|
||||
Bukkit.getPluginManager().callEvent(chestSortEvent);
|
||||
if (chestSortEvent.isCancelled()) {
|
||||
return;
|
||||
Class<? extends Inventory> invClass = inv.getClass();
|
||||
try {
|
||||
if(invClass.getMethod("getLocation", null) != null) {
|
||||
// This whole try/catch fixes MethodNotFoundException when using inv.getLocation in Spigot 1.8.
|
||||
}
|
||||
if(inv.getLocation() != null) {
|
||||
ChestSortEvent chestSortEvent = new ChestSortEvent(inv);
|
||||
chestSortEvent.loc = inv.getLocation();
|
||||
Bukkit.getPluginManager().callEvent(chestSortEvent);
|
||||
if (chestSortEvent.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
} catch (NoSuchMethodException | SecurityException | IllegalStateException e) {
|
||||
// TODO Auto-generated catch block
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (plugin.debug) {
|
||||
System.out.println(" ");
|
||||
System.out.println(" ");
|
||||
|
@ -1,6 +1,6 @@
|
||||
main: de.jeff_media.ChestSort.ChestSortPlugin
|
||||
name: ChestSort
|
||||
version: 8.10.3
|
||||
version: 8.10.4
|
||||
api-version: 1.13
|
||||
description: Allows automatic chest sorting
|
||||
author: mfnalex
|
||||
|
Loading…
Reference in New Issue
Block a user