Remove duplicate code
This commit is contained in:
parent
9af92fa1e5
commit
75eeafb979
@ -80,23 +80,16 @@ public class TrySitEventListener implements Listener {
|
|||||||
Stairs stairs = null;
|
Stairs stairs = null;
|
||||||
Step step = null;
|
Step step = null;
|
||||||
WoodenStep wStep = null;
|
WoodenStep wStep = null;
|
||||||
boolean blockOkay = false;
|
|
||||||
|
|
||||||
// Check for block is chair
|
// Check for block is chair
|
||||||
for (ChairBlock cb : plugin.allowedBlocks) {
|
|
||||||
if (cb.getMat().equals(block.getType())) {
|
|
||||||
blockOkay = true;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (
|
if (
|
||||||
!player.hasPermission("chairs.sit.antiopcheck") &&
|
isValidChair(block) ||
|
||||||
player.hasPermission("chairs.sit." + block.getType().toString())
|
(
|
||||||
) {
|
!player.hasPermission("chairs.sit.antiopcheck") &&
|
||||||
blockOkay = true;
|
player.hasPermission("chairs.sit." + block.getType().toString())
|
||||||
}
|
)
|
||||||
if (blockOkay) {
|
)
|
||||||
|
{
|
||||||
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 Step) {
|
||||||
|
Loading…
Reference in New Issue
Block a user