Added more API and features for Events

This commit is contained in:
Sn0wStorm
2019-11-13 22:07:22 +01:00
parent 48a15a0e82
commit 3332354846
29 changed files with 672 additions and 224 deletions
+3 -3
View File
@@ -169,7 +169,7 @@ public class BUtil {
Barrel barrel = Barrel.getBySpigot(block);
if (barrel != null) {
if (barrel.hasPermsDestroy(player, block, reason)) {
barrel.remove(null, player);
barrel.remove(null, player, true);
return true;
} else {
return false;
@@ -183,7 +183,7 @@ public class BUtil {
if (barrel2 != null) {
if (!barrel2.isLarge()) {
if (barrel2.hasPermsDestroy(player, block, reason)) {
barrel2.remove(null, player);
barrel2.remove(null, player, true);
return true;
} else {
return false;
@@ -198,7 +198,7 @@ public class BUtil {
Barrel barrel3 = Barrel.getByWood(block);
if (barrel3 != null) {
if (barrel3.hasPermsDestroy(player, block, reason)) {
barrel3.remove(block, player);
barrel3.remove(block, player, true);
} else {
return false;
}
@@ -291,4 +291,13 @@ public class LegacyUtil {
}
}
@SuppressWarnings("deprecation")
public static boolean hasBytesItem(ItemMeta meta, NamespacedKey key) {
if (NewNbtVer) {
return meta.getPersistentDataContainer().has(key, org.bukkit.persistence.PersistentDataType.BYTE_ARRAY);
} else {
return meta.getCustomTagContainer().hasCustomTag(key, org.bukkit.inventory.meta.tags.ItemTagType.BYTE_ARRAY);
}
}
}