Remove data value from chair block, bukkit doesn't support in anymore

This commit is contained in:
Shevchik 2013-12-13 13:19:33 +04:00
parent 89309be623
commit cb0b871ea2
2 changed files with 8 additions and 21 deletions

View File

@ -13,12 +13,10 @@ import org.bukkit.Material;
public class ChairBlock { public class ChairBlock {
private Material mat; private Material mat;
private double sitHeight; private double sitHeight;
private byte data;
public ChairBlock(Material m, double s, String d) { public ChairBlock(Material m, double s) {
mat = m; mat = m;
sitHeight = s; sitHeight = s;
data = Byte.parseByte(d);
} }
public Material getMat() { public Material getMat() {
@ -29,7 +27,4 @@ public class ChairBlock {
return sitHeight; return sitHeight;
} }
public byte getDamage() {
return data;
}
} }

View File

@ -171,24 +171,16 @@ public class Chairs extends JavaPlugin {
for (String s : getConfig().getStringList("allowed-blocks")) { for (String s : getConfig().getStringList("allowed-blocks")) {
String type; String type;
double sh = 0.7; double sh = 0.7;
String d = "0"; String tmp[] = s.split("[:]");
if (s.contains(":")) { type = tmp[0];
String tmp[] = s.split(":",3); if (tmp.length == 2) {
type = tmp[0]; sh = Double.parseDouble(tmp[1]);
if (!tmp[1].isEmpty()) {
sh = Double.parseDouble(tmp[1]);
}
if (tmp.length == 3) {
d = tmp[2];
}
} else {
type = s;
} }
try { try {
Material mat = Material.matchMaterial(type); Material mat = Material.matchMaterial(type);
if (mat != null) { if (mat != null) {
logInfo("Allowed block: " + mat.toString() + " => " + sh + " => " + d); logInfo("Allowed block: " + mat.toString() + " => " + sh);
allowedBlocks.add(new ChairBlock(mat,sh,d)); allowedBlocks.add(new ChairBlock(mat,sh));
} else { } else {
logError("Invalid block: " + type); logError("Invalid block: " + type);
} }