diff --git a/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/linkedBeaconTeleporter/listener/OnBlockBreak.java b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/linkedBeaconTeleporter/listener/OnBlockBreak.java new file mode 100644 index 0000000..dca66c9 --- /dev/null +++ b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/linkedBeaconTeleporter/listener/OnBlockBreak.java @@ -0,0 +1,11 @@ +package eu.ruekov.ruakij.LinkedBeaconTeleporters.linkedBeaconTeleporter.listener; + +import eu.ruekov.ruakij.LinkedBeaconTeleporters.linkedBeaconTeleporter.LinkedBeaconTeleporterBlock; +import org.bukkit.event.block.BlockBreakEvent; + +public class OnBlockBreak { + + public static void onBlockBreakEvent(BlockBreakEvent e, LinkedBeaconTeleporterBlock lbtBlock){ + + } +} diff --git a/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/listener/OnBlockBreak.java b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/listener/OnBlockBreak.java index 8b1622b..cbf4eff 100644 --- a/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/listener/OnBlockBreak.java +++ b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/listener/OnBlockBreak.java @@ -1,5 +1,10 @@ package eu.ruekov.ruakij.LinkedBeaconTeleporters.listener; +import eu.ruekov.ruakij.LinkedBeaconTeleporters.Main; +import eu.ruekov.ruakij.LinkedBeaconTeleporters.linkedBeaconTeleporter.LinkedBeaconTeleporterBlock; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.block.Block; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; @@ -9,6 +14,16 @@ public class OnBlockBreak implements Listener { @EventHandler(priority = EventPriority.LOW) public void onBlockBreakEvent(BlockBreakEvent e){ + Block block = e.getBlock(); + Location loc = block.getLocation(); + if(block.getType() == Material.BEACON){ + // Check if this beacon is a LinkedBeaconTeleporter + LinkedBeaconTeleporterBlock lbtBlock = LinkedBeaconTeleporterBlock.getFromLocation(loc); + + if(lbtBlock != null){ + eu.ruekov.ruakij.LinkedBeaconTeleporters.linkedBeaconTeleporter.listener.OnBlockBreak.onBlockBreakEvent(e, lbtBlock); + } + } } }