diff --git a/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/linkedBeaconTeleporter/listener/OnBlockPlace.java b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/linkedBeaconTeleporter/listener/OnBlockPlace.java new file mode 100644 index 0000000..57d9e89 --- /dev/null +++ b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/linkedBeaconTeleporter/listener/OnBlockPlace.java @@ -0,0 +1,11 @@ +package eu.ruekov.ruakij.LinkedBeaconTeleporters.linkedBeaconTeleporter.listener; + +import eu.ruekov.ruakij.LinkedBeaconTeleporters.linkedBeaconTeleporter.LinkedBeaconTeleporterItem; +import org.bukkit.event.block.BlockPlaceEvent; + +public class OnBlockPlace { + + public static void onBlockPlaceEvent(BlockPlaceEvent e, LinkedBeaconTeleporterItem lbtItem){ + + } +} diff --git a/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/listener/OnBlockPlace.java b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/listener/OnBlockPlace.java index c7eddaa..d117163 100644 --- a/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/listener/OnBlockPlace.java +++ b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/listener/OnBlockPlace.java @@ -1,16 +1,28 @@ package eu.ruekov.ruakij.LinkedBeaconTeleporters.listener; +import eu.ruekov.ruakij.LinkedBeaconTeleporters.linkedBeaconTeleporter.LinkedBeaconTeleporterItem; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.block.BlockPlaceEvent; +import org.bukkit.inventory.ItemStack; public class OnBlockPlace implements Listener { @EventHandler(priority = EventPriority.LOW) public void onBlockPlaceEvent(BlockPlaceEvent e){ + ItemStack item = e.getItemInHand(); + + if(item.getType() == Material.BEACON){ + // Check if this beacon is a LinkedBeaconTeleporter + LinkedBeaconTeleporterItem lbtItem = LinkedBeaconTeleporterItem.getFromItemStack(item); + + if(lbtItem != null){ + eu.ruekov.ruakij.LinkedBeaconTeleporters.linkedBeaconTeleporter.listener.OnBlockPlace.onBlockPlaceEvent(e, lbtItem); + } + } } }