Skip to content

Commit

Permalink
Bump version to 1.2.0 and add config value test
Browse files Browse the repository at this point in the history
  • Loading branch information
Realizedd committed Apr 9, 2022
1 parent 07c44f6 commit 31adc19
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ public ZoneListener(final ArenaRegen extension, final ZoneManager zoneManager) {
this.config = extension.getConfiguration();
this.lang = extension.getLang();
this.zoneManager = zoneManager;
System.out.println("trackBlockChanges=" + config.isTrackBlockChanges());
System.out.println("isPreventBlockExplode=" + config.isPreventBlockExplode());
}

@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
Expand Down Expand Up @@ -181,45 +183,45 @@ public void on(final BlockBurnEvent event) {
}


// @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
// public void on(final EntityExplodeEvent event) {
// final Zone zone = zoneManager.get(event.getEntity().getLocation().getBlock());
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void on(final EntityExplodeEvent event) {
final Zone zone = zoneManager.get(event.getEntity().getLocation().getBlock());

// if (zone == null) {
// return;
// }
if (zone == null) {
return;
}

// if (config.isTrackBlockChanges()) {
// zone.track(event.blockList());
// }
if (config.isTrackBlockChanges()) {
zone.track(event.blockList());
}

// if (!config.isPreventBlockExplode()) {
// return;
// }
if (!config.isPreventBlockExplode()) {
return;
}

// event.setCancelled(true);
// }
event.setCancelled(true);
}


// @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
// public void on(final BlockExplodeEvent event) {
// final Block block = event.getBlock();
// final Zone zone = zoneManager.get(block);
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void on(final BlockExplodeEvent event) {
final Block block = event.getBlock();
final Zone zone = zoneManager.get(block);

// if (zone == null) {
// return;
// }
if (zone == null) {
return;
}

// if (config.isTrackBlockChanges()) {
// zone.track(event.blockList());
// }
if (config.isTrackBlockChanges()) {
zone.track(event.blockList());
}

// if (!config.isPreventBlockExplode()) {
// return;
// }
if (!config.isPreventBlockExplode()) {
return;
}

// event.setCancelled(true);
// }
event.setCancelled(true);
}


@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ public void run() {
if (handler instanceof NMSHandler) {
zone.startTask(null);
zone.getArena().setDisabled(false);

if (onDone != null) {
onDone.call();
}

return;
}

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ buildscript {

allprojects {
group 'me.realized.de'
version '1.1.0'
version '1.2.0'
}

subprojects {
Expand Down

0 comments on commit 31adc19

Please sign in to comment.