mirror of
https://github.com/darksaid98/AlathranWars.git
synced 2026-12-04 06:28:51 +00:00
perm check for break/place
This commit is contained in:
1 parent
18f32af4b2
commit
9f98cc0fae
1 file changed
+7
@@ -31,6 +31,7 @@ public class BlockBreakListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onBlockBreak(final BlockBreakEvent event) {
|
public void onBlockBreak(final BlockBreakEvent event) {
|
||||||
|
|
||||||
final Block block = event.getBlock();
|
final Block block = event.getBlock();
|
||||||
if (SiegeData.getSieges().isEmpty() && RaidData.getRaids().isEmpty()) {
|
if (SiegeData.getSieges().isEmpty() && RaidData.getRaids().isEmpty()) {
|
||||||
return;
|
return;
|
||||||
@@ -45,6 +46,9 @@ public class BlockBreakListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Player p = event.getPlayer();
|
Player p = event.getPlayer();
|
||||||
|
if(p.hasPermission("AlathraWar.break")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (WorldCoord.parseWorldCoord(block).getTownOrNull() != null) {
|
if (WorldCoord.parseWorldCoord(block).getTownOrNull() != null) {
|
||||||
for (final Siege siege : SiegeData.getSieges()) {
|
for (final Siege siege : SiegeData.getSieges()) {
|
||||||
if (siege.getTown() == WorldCoord.parseWorldCoord(block).getTownOrNull()) {
|
if (siege.getTown() == WorldCoord.parseWorldCoord(block).getTownOrNull()) {
|
||||||
@@ -74,6 +78,9 @@ public class BlockBreakListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Player p = event.getPlayer();
|
Player p = event.getPlayer();
|
||||||
|
if(p.hasPermission("AlathraWar.place")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (WorldCoord.parseWorldCoord(block).getTownOrNull() != null) {
|
if (WorldCoord.parseWorldCoord(block).getTownOrNull() != null) {
|
||||||
for (final Siege siege : SiegeData.getSieges()) {
|
for (final Siege siege : SiegeData.getSieges()) {
|
||||||
if (siege.getTown() == WorldCoord.parseWorldCoord(block).getTownOrNull()) {
|
if (siege.getTown() == WorldCoord.parseWorldCoord(block).getTownOrNull()) {
|
||||||
|
|||||||
Reference in new issue
Block a user