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; type = s;
} }
try { try {
Material mat; Material mat = Material.matchMaterial(type);
if (type.matches("\\d+")) {
mat = Material.getMaterial(Integer.parseInt(type));
} else {
mat = Material.matchMaterial(type);
}
if (mat != null) { if (mat != null) {
logInfo("Allowed block: " + mat.toString() + " => " + sh + " => " + d); logInfo("Allowed block: " + mat.toString() + " => " + sh + " => " + d);
allowedBlocks.add(new ChairBlock(mat,sh,d)); allowedBlocks.add(new ChairBlock(mat,sh,d));
@ -231,11 +226,7 @@ public class Chairs extends JavaPlugin {
validSigns = new ArrayList<Material>(); validSigns = new ArrayList<Material>();
for (String type : getConfig().getStringList("valid-signs")) { for (String type : getConfig().getStringList("valid-signs")) {
try { try {
if (type.matches("\\d+")) { validSigns.add(Material.matchMaterial(type));
validSigns.add(Material.getMaterial(Integer.parseInt(type)));
} else {
validSigns.add(Material.matchMaterial(type));
}
} }
catch (Exception e) { catch (Exception e) {
logError(e.getMessage()); logError(e.getMessage());

View File

@ -100,18 +100,12 @@ public class EventListener implements Listener {
blockOkay = true; blockOkay = true;
continue; continue;
} }
} else if (cb.getMat().equals(block.getType()) } else if (cb.getMat().equals(block.getType())) {
&& cb.getDamage() == block.getData()) {
blockOkay = true; blockOkay = true;
continue; continue;
} }
} }
if ( if (player.hasPermission("chairs.sit." + block.getType().toString())) {
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())
) {
blockOkay = true; blockOkay = true;
} }
if (blockOkay) { if (blockOkay) {
@ -221,8 +215,7 @@ public class EventListener implements Listener {
sh = cb.getSitHeight(); sh = cb.getSitHeight();
continue; continue;
} }
} else if (cb.getMat().equals(block.getType()) } else if (cb.getMat().equals(block.getType())) {
&& cb.getDamage() == block.getData()) {
sh = cb.getSitHeight(); sh = cb.getSitHeight();
continue; continue;
} }