Skip to content

Commit

Permalink
fix to prepare release
Browse files Browse the repository at this point in the history
  • Loading branch information
TheoKah committed Oct 8, 2017
1 parent 202d36b commit 2e9d359
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 26 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

group = 'com.carrot'
version = '2.10-S5.1-MC1.10.2-SNAPSHOT'
version = '2.9-S5.1-MC1.10.2-SNAPSHOT'
description = 'A towny-like worldguard-like zone managment plugin'

dependencies {
Expand Down
47 changes: 22 additions & 25 deletions src/main/java/com/arckenver/nations/listener/BuildPermListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,14 @@ public void onPlayerChangeBlock(ChangeBlockEvent.Pre event, @First Player player
return;
}
for (Location<World> loc : event.getLocations()) {
if (!ConfigHandler.isWhitelisted("break", loc.getBlock().getId())) {
if(!DataHandler.getPerm("build", player.getUniqueId(), loc))
{
event.setCancelled(true);
try {
player.sendMessage(Text.of(TextColors.RED, LanguageHandler.ERROR_PERM_BUILD));
} catch (Exception e) {}
return;
}
if (!ConfigHandler.isWhitelisted("break", loc.getBlock().getId())
&& !DataHandler.getPerm("build", player.getUniqueId(), loc))
{
event.setCancelled(true);
try {
player.sendMessage(Text.of(TextColors.RED, LanguageHandler.ERROR_PERM_BUILD));
} catch (Exception e) {}
return;
}
}
}
Expand All @@ -62,14 +61,13 @@ public void onPlayerPlacesBlock(ChangeBlockEvent.Place event, @First Player play
.getTransactions()
.stream()
.forEach(trans -> trans.getOriginal().getLocation().ifPresent(loc -> {
if (!ConfigHandler.isWhitelisted("build", trans.getFinal().getState().getType().getId())) {
if(!DataHandler.getPerm("build", player.getUniqueId(), loc))
{
trans.setValid(false);
try {
player.sendMessage(Text.of(TextColors.RED, LanguageHandler.ERROR_PERM_BUILD));
} catch (Exception e) {}
}
if (!ConfigHandler.isWhitelisted("build", trans.getFinal().getState().getType().getId())
&& !DataHandler.getPerm("build", player.getUniqueId(), loc))
{
trans.setValid(false);
try {
player.sendMessage(Text.of(TextColors.RED, LanguageHandler.ERROR_PERM_BUILD));
} catch (Exception e) {}
}
}));
}
Expand All @@ -89,14 +87,13 @@ public void onPlayerBreaksBlock(ChangeBlockEvent.Break event, @First Player play
.getTransactions()
.stream()
.forEach(trans -> trans.getOriginal().getLocation().ifPresent(loc -> {
if (!ConfigHandler.isWhitelisted("break", trans.getFinal().getState().getType().getId())) {
if(!DataHandler.getPerm("build", player.getUniqueId(), loc))
{
trans.setValid(false);
try {
player.sendMessage(Text.of(TextColors.RED, LanguageHandler.ERROR_PERM_BUILD));
} catch (Exception e) {}
}
if (!ConfigHandler.isWhitelisted("break", trans.getFinal().getState().getType().getId())
&& !DataHandler.getPerm("build", player.getUniqueId(), loc))
{
trans.setValid(false);
try {
player.sendMessage(Text.of(TextColors.RED, LanguageHandler.ERROR_PERM_BUILD));
} catch (Exception e) {}
}
}));
}
Expand Down

0 comments on commit 2e9d359

Please sign in to comment.