8.17.6 release

This commit is contained in:
mfnalex 2020-09-13 21:20:19 +02:00
parent 2df5959fac
commit 127cbb2e1c
5 changed files with 17 additions and 4 deletions

View File

@ -1,5 +1,8 @@
# Changelog
## 8.17.6
- Fixed exception and hotbar being filled up with barrier blocks when using the addition right-click-hotkey on MC 1.8
## 8.17.5
- Fixed "/invsort hotbar" and "/invsort all" only sorting the normal inventory when "allow-automatic-inventory-sorting" is set to false

View File

@ -9,7 +9,7 @@
<name>ChestSort</name>
<url>https://www.chestsort.de</url>
<description>Automatically sorts your chests!</description>
<version>8.17.5</version>
<version>8.17.6</version>
<packaging>jar</packaging>
<properties>

View File

@ -4,6 +4,7 @@ import de.jeff_media.ChestSort.hooks.CrackShotHook;
import de.jeff_media.ChestSort.hooks.InventoryPagesHook;
import de.jeff_media.ChestSort.utils.CategoryLinePair;
import de.jeff_media.ChestSort.utils.TypeMatchPositionPair;
import de.jeff_media.ChestSort.utils.Utils;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.enchantments.Enchantment;
@ -164,8 +165,8 @@ public class ChestSortOrganizer {
return totalEnchants;
}
static boolean doesInventoryContain(Inventory inv, Material mat) {
for (ItemStack item : inv.getStorageContents()) {
boolean doesInventoryContain(Inventory inv, Material mat) {
for (ItemStack item : Utils.getStorageContents(inv,plugin.mcMinorVersion)) {
if (item == null) continue;
if (item.getType() == mat) {
return true;

View File

@ -7,8 +7,17 @@ import java.io.IOException;
import java.io.InputStream;
import de.jeff_media.ChestSort.ChestSortPlugin;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
public class Utils {
public static ItemStack[] getStorageContents(Inventory inv, int bukkitMinorVersion) {
if(bukkitMinorVersion<=8) {
return inv.getContents();
}
return inv.getStorageContents();
}
// We need this to write the category files inside the .jar to the disk
// Maybe there is a smarter way, i don't know.

View File

@ -1,6 +1,6 @@
main: de.jeff_media.ChestSort.ChestSortPlugin
name: ChestSort
version: 8.17.5
version: 8.17.6
api-version: "1.13"
description: Allows automatic chest sorting
author: mfnalex