Scan for 2 additional blocks

This commit is contained in:
Shevchik 2015-01-17 11:15:33 +04:00
parent 93e678e749
commit 10d0661066

View File

@ -232,7 +232,7 @@ public class TrySitEventListener implements Listener {
private boolean checkSign(Block block, BlockFace face) { private boolean checkSign(Block block, BlockFace face) {
// Go through the blocks next to the clicked block and check if are signs on the end. // Go through the blocks next to the clicked block and check if are signs on the end.
for (int i = 1; i <= plugin.maxChairWidth + 1; i++) { for (int i = 1; i <= plugin.maxChairWidth + 2; i++) {
Block relative = block.getRelative(face, i); Block relative = block.getRelative(face, i);
if (checkDirection(block, relative)) { if (checkDirection(block, relative)) {
continue; continue;
@ -258,7 +258,7 @@ public class TrySitEventListener implements Listener {
private boolean checkFrame(Block block, BlockFace face, Player player) { private boolean checkFrame(Block block, BlockFace face, Player player) {
// Go through the blocks next to the clicked block and check if are signs on the end. // Go through the blocks next to the clicked block and check if are signs on the end.
for (int i = 1; i <= 100; i++) { for (int i = 1; i <= plugin.maxChairWidth + 2; i++) {
Block relative = block.getRelative(face, i); Block relative = block.getRelative(face, i);
if (checkDirection(block, relative)) { if (checkDirection(block, relative)) {
continue; continue;