Skip to content

Commit

Permalink
Fixed no perm err msg even though player has perm
Browse files Browse the repository at this point in the history
  • Loading branch information
Arckenver committed Apr 8, 2016
1 parent 74aace2 commit 703899e
Showing 1 changed file with 8 additions and 2 deletions.
Expand Up @@ -24,7 +24,10 @@ public void onPlayerPlacesBlock(ChangeBlockEvent.Place event, @First Player play
.stream()
.forEach(trans -> trans.getOriginal().getLocation().ifPresent(loc -> {
trans.setValid(DataHandler.getPerm("build", player.getUniqueId(), loc));
player.sendMessage(Text.of(TextColors.RED, LanguageHandler.HH));
if(!DataHandler.getPerm("build", player.getUniqueId(), loc))
{
player.sendMessage(Text.of(TextColors.RED, LanguageHandler.HH));
}
}));
}

Expand All @@ -40,7 +43,10 @@ public void onPlayerBreaksBlock(ChangeBlockEvent.Break event, @First Player play
.stream()
.forEach(trans -> trans.getOriginal().getLocation().ifPresent(loc -> {
trans.setValid(DataHandler.getPerm("build", player.getUniqueId(), loc));
player.sendMessage(Text.of(TextColors.RED, LanguageHandler.HH));
if(!DataHandler.getPerm("build", player.getUniqueId(), loc))
{
player.sendMessage(Text.of(TextColors.RED, LanguageHandler.HH));
}
}));
}
}

0 comments on commit 703899e

Please sign in to comment.