forked from zhdev/griefus
Split up utility class
This commit is contained in:
parent
828af8443f
commit
e2c2505b2b
97 changed files with 2369 additions and 2104 deletions
|
|
@ -30,6 +30,7 @@ import org.bukkit.potion.PotionEffect;
|
|||
import org.bukkit.potion.PotionType;
|
||||
|
||||
import net.coreprotect.config.ConfigHandler;
|
||||
import net.coreprotect.utility.BlockUtils;
|
||||
import net.coreprotect.utility.Util;
|
||||
|
||||
public class BukkitAdapter implements BukkitInterface {
|
||||
|
|
@ -171,7 +172,7 @@ public class BukkitAdapter implements BukkitInterface {
|
|||
|
||||
@Override
|
||||
public boolean isInvisible(Material material) {
|
||||
return Util.isAir(material);
|
||||
return BlockUtils.isAir(material);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -25,7 +25,8 @@ import org.bukkit.inventory.meta.BundleMeta;
|
|||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import net.coreprotect.model.BlockGroup;
|
||||
import net.coreprotect.utility.Util;
|
||||
import net.coreprotect.utility.ItemUtils;
|
||||
import net.coreprotect.utility.MaterialUtils;
|
||||
|
||||
public class Bukkit_v1_17 extends BukkitAdapter implements BukkitInterface {
|
||||
|
||||
|
|
@ -59,7 +60,7 @@ public class Bukkit_v1_17 extends BukkitAdapter implements BukkitInterface {
|
|||
public int getLegacyBlockId(Material material) {
|
||||
switch (material) {
|
||||
case DIRT_PATH:
|
||||
return Util.getBlockId("GRASS_PATH", false);
|
||||
return MaterialUtils.getBlockId("GRASS_PATH", false);
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -123,7 +124,7 @@ public class Bukkit_v1_17 extends BukkitAdapter implements BukkitInterface {
|
|||
if (subMeta.hasItems()) {
|
||||
list = new ArrayList<>();
|
||||
for (ItemStack itemStack : subMeta.getItems()) {
|
||||
Map<String, Object> itemMap = Util.serializeItemStack(itemStack, null, slot);
|
||||
Map<String, Object> itemMap = ItemUtils.serializeItemStack(itemStack, null, slot);
|
||||
if (itemMap.size() > 0) {
|
||||
list.add(itemMap);
|
||||
}
|
||||
|
|
@ -146,7 +147,7 @@ public class Bukkit_v1_17 extends BukkitAdapter implements BukkitInterface {
|
|||
if ((rowType == Material.BUNDLE)) {
|
||||
BundleMeta meta = (BundleMeta) itemstack.getItemMeta();
|
||||
for (Map<String, Object> itemData : map) {
|
||||
ItemStack itemStack = Util.unserializeItemStack(itemData);
|
||||
ItemStack itemStack = ItemUtils.unserializeItemStack(itemData);
|
||||
if (itemStack != null) {
|
||||
meta.addItem(itemStack);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue