forked from LogBlock/LogBlock
Added QueryParams column selection. All plugins using
getBlockChanges() will break.
This commit is contained in:
@@ -20,6 +20,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.TNTPrimed;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.material.MaterialData;
|
||||
|
||||
public class BukkitUtils
|
||||
{
|
||||
@@ -125,6 +126,19 @@ public class BukkitUtils
|
||||
return mat != null ? mat.toString().replace('_', ' ').toLowerCase() : String.valueOf(type);
|
||||
}
|
||||
|
||||
public static String materialName(int type, byte rawData) {
|
||||
final Material mat = Material.getMaterial(type);
|
||||
if (mat != null) {
|
||||
if (type == 6 || type == 17 || type == 18 || type == 35 || type == 43 || type == 44) {
|
||||
final MaterialData data = mat.getNewData(rawData);
|
||||
if (data != null)
|
||||
return data.toString().toLowerCase().replace('_', ' ').replaceAll("[^a-z ]", "");
|
||||
}
|
||||
return mat.toString().replace('_', ' ').toLowerCase();
|
||||
}
|
||||
return String.valueOf(type);
|
||||
}
|
||||
|
||||
public static String senderName(CommandSender sender) {
|
||||
if (sender instanceof Player)
|
||||
return ((Player)sender).getName();
|
||||
|
||||
Reference in New Issue
Block a user