Addressed some comments

This commit is contained in:
MattBDev
2020-04-15 15:26:54 -04:00
parent 9c3c42c3e6
commit 780be3776a
411 changed files with 2683 additions and 2666 deletions

View File

@ -0,0 +1,31 @@
package com.plotsquared.bukkit.util;
import com.sk89q.worldedit.bukkit.BukkitAdapter;
import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.world.item.ItemType;
import org.bukkit.Material;
import org.bukkit.block.Block;
import java.util.function.Supplier;
public class BukkitBlockUtil {
public static Supplier<ItemType> supplyItem(Block block) {
return new Supplier<ItemType>() {
@Override public ItemType get() {
return BukkitAdapter.asItemType(block.getType());
}
};
}
public static Supplier<ItemType> supplyItem(Material type) {
return () -> BukkitAdapter.asItemType(type);
}
public static BlockState get(Block block) {
return get(block.getType());
}
public static BlockState get(Material material) {
return BukkitAdapter.asBlockType(material).getDefaultState();
}
}