Remove deprecated data

This commit is contained in:
Shevchik 2013-12-11 15:37:52 +04:00
parent 3f60b5ee27
commit 7dedc538a9
2 changed files with 5 additions and 21 deletions

View File

@ -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,12 +226,8 @@ public class Chairs extends JavaPlugin {
validSigns = new ArrayList<Material>();
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));
}
}
catch (Exception e) {
logError(e.getMessage());
}

View File

@ -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;
}