From cb0b871ea28347f81944db09e79dda9ede9793d3 Mon Sep 17 00:00:00 2001 From: Shevchik Date: Fri, 13 Dec 2013 13:19:33 +0400 Subject: [PATCH] Remove data value from chair block, bukkit doesn't support in anymore --- src/com/cnaude/chairs/ChairBlock.java | 9 ++------- src/com/cnaude/chairs/Chairs.java | 20 ++++++-------------- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/src/com/cnaude/chairs/ChairBlock.java b/src/com/cnaude/chairs/ChairBlock.java index 4f6fca2..6dab811 100644 --- a/src/com/cnaude/chairs/ChairBlock.java +++ b/src/com/cnaude/chairs/ChairBlock.java @@ -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() { @@ -28,8 +26,5 @@ public class ChairBlock { public double getSitHeight() { return sitHeight; } - - public byte getDamage() { - return data; - } + } diff --git a/src/com/cnaude/chairs/Chairs.java b/src/com/cnaude/chairs/Chairs.java index 1cc3739..2bd98ee 100644 --- a/src/com/cnaude/chairs/Chairs.java +++ b/src/com/cnaude/chairs/Chairs.java @@ -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); - type = tmp[0]; - if (!tmp[1].isEmpty()) { - sh = Double.parseDouble(tmp[1]); - } - if (tmp.length == 3) { - d = tmp[2]; - } - } else { - type = s; + String tmp[] = s.split("[:]"); + type = tmp[0]; + if (tmp.length == 2) { + sh = Double.parseDouble(tmp[1]); } 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); }