Remove data value from chair block, bukkit doesn't support in anymore
This commit is contained in:
parent
89309be623
commit
cb0b871ea2
@ -13,12 +13,10 @@ import org.bukkit.Material;
|
||||
public class ChairBlock {
|
||||
private Material mat;
|
||||
private double sitHeight;
|
||||
private byte data;
|
||||
|
||||
public ChairBlock(Material m, double s, String d) {
|
||||
public ChairBlock(Material m, double s) {
|
||||
mat = m;
|
||||
sitHeight = s;
|
||||
data = Byte.parseByte(d);
|
||||
}
|
||||
|
||||
public Material getMat() {
|
||||
@ -29,7 +27,4 @@ public class ChairBlock {
|
||||
return sitHeight;
|
||||
}
|
||||
|
||||
public byte getDamage() {
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
@ -171,24 +171,16 @@ public class Chairs extends JavaPlugin {
|
||||
for (String s : getConfig().getStringList("allowed-blocks")) {
|
||||
String type;
|
||||
double sh = 0.7;
|
||||
String d = "0";
|
||||
if (s.contains(":")) {
|
||||
String tmp[] = s.split(":",3);
|
||||
String tmp[] = s.split("[:]");
|
||||
type = tmp[0];
|
||||
if (!tmp[1].isEmpty()) {
|
||||
if (tmp.length == 2) {
|
||||
sh = Double.parseDouble(tmp[1]);
|
||||
}
|
||||
if (tmp.length == 3) {
|
||||
d = tmp[2];
|
||||
}
|
||||
} else {
|
||||
type = s;
|
||||
}
|
||||
try {
|
||||
Material mat = Material.matchMaterial(type);
|
||||
if (mat != null) {
|
||||
logInfo("Allowed block: " + mat.toString() + " => " + sh + " => " + d);
|
||||
allowedBlocks.add(new ChairBlock(mat,sh,d));
|
||||
logInfo("Allowed block: " + mat.toString() + " => " + sh);
|
||||
allowedBlocks.add(new ChairBlock(mat,sh));
|
||||
} else {
|
||||
logError("Invalid block: " + type);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user