diff --git a/src/com/cnaude/chairs/Chairs.java b/src/com/cnaude/chairs/Chairs.java index 3a7dc4d..3165e13 100644 --- a/src/com/cnaude/chairs/Chairs.java +++ b/src/com/cnaude/chairs/Chairs.java @@ -210,12 +210,7 @@ public class Chairs extends JavaPlugin { type = s; } try { - Material mat; - if (type.matches("\\d+")) { - mat = Material.getMaterial(Integer.parseInt(type)); - } else { - mat = Material.matchMaterial(type); - } + Material mat = Material.matchMaterial(type); if (mat != null) { logInfo("Allowed block: " + mat.toString() + " => " + sh + " => " + d); allowedBlocks.add(new ChairBlock(mat,sh,d)); @@ -231,11 +226,7 @@ public class Chairs extends JavaPlugin { validSigns = new ArrayList(); for (String type : getConfig().getStringList("valid-signs")) { try { - if (type.matches("\\d+")) { - validSigns.add(Material.getMaterial(Integer.parseInt(type))); - } else { - validSigns.add(Material.matchMaterial(type)); - } + validSigns.add(Material.matchMaterial(type)); } catch (Exception e) { logError(e.getMessage()); diff --git a/src/com/cnaude/chairs/EventListener.java b/src/com/cnaude/chairs/EventListener.java index 521d692..a2a6541 100644 --- a/src/com/cnaude/chairs/EventListener.java +++ b/src/com/cnaude/chairs/EventListener.java @@ -100,18 +100,12 @@ public class EventListener implements Listener { blockOkay = true; continue; } - } else if (cb.getMat().equals(block.getType()) - && cb.getDamage() == block.getData()) { + } else if (cb.getMat().equals(block.getType())) { blockOkay = true; continue; } } - if ( - player.hasPermission("chairs.sit." + block.getTypeId() + ":" + block.getData()) || - player.hasPermission("chairs.sit." + block.getType().toString() + ":" + block.getData()) || - player.hasPermission("chairs.sit." + block.getTypeId()) || - player.hasPermission("chairs.sit." + block.getType().toString()) - ) { + if (player.hasPermission("chairs.sit." + block.getType().toString())) { blockOkay = true; } if (blockOkay) { @@ -221,8 +215,7 @@ public class EventListener implements Listener { sh = cb.getSitHeight(); continue; } - } else if (cb.getMat().equals(block.getType()) - && cb.getDamage() == block.getData()) { + } else if (cb.getMat().equals(block.getType())) { sh = cb.getSitHeight(); continue; }