Properly get sit height

This commit is contained in:
Shevchik 2013-12-14 22:09:38 +04:00
parent 939a70808f
commit bd5b538f1d

View File

@ -237,24 +237,15 @@ public class EventListener implements Listener {
double sh = 0.7; double sh = 0.7;
for (ChairBlock cb : plugin.allowedBlocks) { for (ChairBlock cb : plugin.allowedBlocks) {
if (cb.getMat().toString().contains("STAIRS")) { if (cb.getMat().equals(block.getType())) {
if (cb.getMat().equals(block.getType())) {
sh = cb.getSitHeight();
continue;
}
} else if (cb.getMat().equals(block.getType())) {
sh = cb.getSitHeight(); sh = cb.getSitHeight();
continue; break;
} }
} }
Stairs stairs = null; Stairs stairs = null;
if (block.getState().getData() instanceof Stairs) { if (block.getState().getData() instanceof Stairs) {
stairs = (Stairs) block.getState().getData(); stairs = (Stairs) block.getState().getData();
} else if (block.getState().getData() instanceof Step) {
} else if (block.getState().getData() instanceof WoodenStep) {
} else {
sh += plugin.sittingHeightAdj;
} }
Location plocation = block.getLocation().clone(); Location plocation = block.getLocation().clone();