3.7 added barrel support

This commit is contained in:
mfnalex 2019-04-27 15:22:04 +02:00
parent b5de10dd67
commit 8019717f50
3 changed files with 9 additions and 3 deletions

View File

@ -5,7 +5,7 @@
<groupId>de.jeffclan</groupId>
<artifactId>JeffChestSort</artifactId>
<version>3.6</version>
<version>3.7</version>
<packaging>jar</packaging>
<name>JeffChestSort</name>

View File

@ -96,9 +96,15 @@ public class JeffChestSortListener implements Listener {
JeffChestSortPlayerSetting setting = plugin.PerPlayerSettings.get(p.getUniqueId().toString());
// We use .getClass().toString() for new items instead of directly comparing the ENUM, because we want to
// keep compatability between different minecraft versions (e.g. there is no BARREL prior 1.14)
// WARNING: The names are inconsistent! A chest will return org.bukkit.craftbukkit.v1_14_R1.block.CraftChest
// while a double chest returns org.bukkit.block.DoubleChest
//p.sendMessage(event.getInventory().getHolder().toString());
if (!(event.getInventory().getHolder() instanceof Chest)
&& !(event.getInventory().getHolder() instanceof DoubleChest)
&& !(event.getInventory().getHolder() instanceof ShulkerBox)) {
&& !(event.getInventory().getHolder() instanceof ShulkerBox)
&& !(event.getInventory().getHolder().getClass().toString().endsWith(".CraftBarrel"))) {
return;
}

View File

@ -1,6 +1,6 @@
main: de.jeffclan.JeffChestSort.JeffChestSortPlugin
name: ChestSort
version: 3.6
version: 3.7
api-version: 1.13
description: Allows automatic chest sorting
author: mfnalex