Skip to content

Commit

Permalink
Added Nether Fortress advancement giver
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Jan 3, 2023
1 parent 36a7769 commit af40f5e
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import org.bukkit.Server;
import org.bukkit.Sound;
import org.bukkit.Statistic;
import org.bukkit.World.Environment;
import org.bukkit.advancement.Advancement;
import org.bukkit.advancement.AdvancementProgress;
import org.bukkit.block.BlockFace;
Expand Down Expand Up @@ -177,12 +176,16 @@ public void onPortal(PlayerPortalEvent e) {
}
}

@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onNetherFortress(PlayerMoveEvent e) {
/**
* Looks for certain blocks, and if they are found then awards an advancement
* @param e - PlayerMoveEvent
*/
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onMove(PlayerMoveEvent e) {
if (!Util.sameWorld(e.getPlayer().getWorld(), addon.getNetherWorld())) {
return;
}
if (e.getTo().getBlock().getRelative(BlockFace.DOWN).getType().equals(Material.NETHER_BRICK)) {
if (e.getTo().getBlock().getRelative(BlockFace.DOWN).getType().equals(Material.NETHER_BRICKS)) {
giveAdv(e.getPlayer(), netherFortressAdvancement);
}
}
Expand Down

0 comments on commit af40f5e

Please sign in to comment.