14.0.3 - should fix issues on paper 1.20.6

This commit is contained in:
mfnalex 2024-05-02 20:38:18 +02:00
parent 02f4d96ff6
commit 7a11054b56
No known key found for this signature in database
GPG Key ID: 4A5852356225BAE1
5 changed files with 8 additions and 26 deletions

View File

@ -9,7 +9,7 @@
<name>ChestSort</name>
<url>https://www.chestsort.de</url>
<description>Allows automatic chest sorting!</description>
<version>14.0.0</version>
<version>14.0.3</version>
<packaging>jar</packaging>
<properties>
@ -226,7 +226,7 @@
<dependency>
<groupId>com.jeff-media.jefflib</groupId>
<artifactId>jefflib</artifactId>
<version>13.0.3</version>
<version>14.0.3</version>
<scope>compile</scope>
</dependency>

View File

@ -260,22 +260,6 @@ public class ChestSortPlugin extends JavaPlugin {
this.chestSortListener = chestSortListener;
}
public int getMcMinorVersion() {
return mcMinorVersion;
}
public void setMcMinorVersion(int mcMinorVersion) {
this.mcMinorVersion = mcMinorVersion;
}
public String getMcVersion() {
return mcVersion;
}
public void setMcVersion(String mcVersion) {
this.mcVersion = mcVersion;
}
public Messages getMessages() {
return messages;
}
@ -598,10 +582,12 @@ public class ChestSortPlugin extends JavaPlugin {
JeffLib.init(this);
String tmpVersion = getServer().getClass().getPackage().getName();
/*String tmpVersion = getServer().getClass().getPackage().getName();
setMcVersion(tmpVersion.substring(tmpVersion.lastIndexOf('.') + 1));
tmpVersion = getMcVersion().substring(getMcVersion().indexOf("_") + 1);
setMcMinorVersion(Integer.parseInt(tmpVersion.substring(0, tmpVersion.indexOf("_"))));
setMcMinorVersion(Integer.parseInt(tmpVersion.substring(0, tmpVersion.indexOf("_"))));*/
load(false);

View File

@ -187,7 +187,7 @@ public class ChestSortOrganizer {
@SuppressWarnings("BooleanMethodIsAlwaysInverted")
boolean doesInventoryContain(Inventory inv, Material mat) {
for (ItemStack item : Utils.getStorageContents(inv, plugin.getMcMinorVersion())) {
for (ItemStack item : Utils.getStorageContents(inv)) {
if (item == null) continue;
if (item.getType() == mat) {
return true;

View File

@ -12,10 +12,7 @@ import org.bukkit.inventory.ItemStack;
public class Utils {
public static ItemStack[] getStorageContents(Inventory inv, int bukkitMinorVersion) {
if(bukkitMinorVersion<=8) {
return inv.getContents();
}
public static ItemStack[] getStorageContents(Inventory inv) {
return inv.getStorageContents();
}

View File

@ -341,7 +341,6 @@ mute-protection-plugins: false
# that contain the word "Backpack"
blocked-inventory-holders-regex:
- ".*[Bb]ack[Pp]ack.*"
- "\Qcom.loohp.interactivechat.objectholders.ICInventoryHolder\E"
##########################
##### Sorting Method #####