Skip to content

Commit

Permalink
Ticket #169
Browse files Browse the repository at this point in the history
  • Loading branch information
zelytra committed Aug 27, 2021
1 parent 49b588f commit bb21d2f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.bukkit.entity.Entity;
import org.bukkit.entity.ExperienceOrb;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.inventory.ItemStack;
Expand All @@ -22,8 +23,10 @@
public class PlayerBreakBlockListener implements Listener {
private static HashMap<Location, BukkitTask> taskIDs = new HashMap<>();

@EventHandler
@EventHandler (priority = EventPriority.HIGH)
public void onBreak(BlockBreakEvent e) {
if(e.isCancelled())
return;

try {
BlockEnum block = BlockEnum.valueOf(e.getBlock().getType().toString());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package fr.zelytra.daedalus.events.running.environnement.structure;

import fr.zelytra.daedalus.Daedalus;
import fr.zelytra.daedalus.events.running.environnement.respawnable.BlockEnum;
import fr.zelytra.daedalus.managers.maze.Maze;
import fr.zelytra.daedalus.managers.maze.Vector2;
import fr.zelytra.daedalus.managers.structure.Structure;
import org.bukkit.Material;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.util.BoundingBox;
Expand All @@ -22,7 +22,7 @@ public class BreakBlockListener implements Listener {
blacklist.add(Material.BROWN_MUSHROOM_BLOCK);
}

@EventHandler
@EventHandler (priority = EventPriority.LOW)
public void onBreak(BlockBreakEvent e) {
if (!Daedalus.getInstance().getGameManager().isRunning()) {
return;
Expand All @@ -46,9 +46,6 @@ public void onBreak(BlockBreakEvent e) {
case -5:
case -6:
case -7:
if (BlockEnum.containType(e.getBlock().getType())) {
break;
}
//Loop structures
for (Map.Entry<BoundingBox, Structure> entry : Daedalus.getInstance().getStructureManager().getStructuresPosition().entrySet()) {
if (entry.getKey().contains(e.getBlock().getX(), e.getBlock().getY(), e.getBlock().getZ())) {
Expand Down

0 comments on commit bb21d2f

Please sign in to comment.