From abde30e2e1260e7bcf7f7b76aa39c0ff7ad8d9c8 Mon Sep 17 00:00:00 2001 From: Ruakij Date: Sun, 9 May 2021 21:38:33 +0200 Subject: [PATCH] Implement first Listeners --- .../ruakij/LinkedBeaconTeleporters/Main.java | 7 ++++++- .../listener/OnBlockBreak.java | 14 ++++++++++++++ .../listener/OnBlockPlace.java | 16 ++++++++++++++++ .../listener/OnPrepareItemCraftEvent.java | 18 ++++++++++++++++++ 4 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/listener/OnBlockBreak.java create mode 100644 src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/listener/OnBlockPlace.java create mode 100644 src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/listener/OnPrepareItemCraftEvent.java diff --git a/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/Main.java b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/Main.java index 9c24ada..35f0ebe 100644 --- a/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/Main.java +++ b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/Main.java @@ -1,5 +1,8 @@ package eu.ruekov.ruakij.LinkedBeaconTeleporters; +import eu.ruekov.ruakij.LinkedBeaconTeleporters.listener.OnBlockBreak; +import eu.ruekov.ruakij.LinkedBeaconTeleporters.listener.OnBlockPlace; +import eu.ruekov.ruakij.LinkedBeaconTeleporters.listener.OnPrepareItemCraftEvent; import org.bukkit.Bukkit; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.YamlConfiguration; @@ -25,7 +28,9 @@ public class Main extends JavaPlugin { plugin = this; PluginManager pluginManager = Bukkit.getPluginManager(); - + pluginManager.registerEvents(new OnBlockBreak(), this); + pluginManager.registerEvents(new OnBlockPlace(), this); + pluginManager.registerEvents(new OnPrepareItemCraftEvent(), this); loadConfigs(); diff --git a/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/listener/OnBlockBreak.java b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/listener/OnBlockBreak.java new file mode 100644 index 0000000..8b1622b --- /dev/null +++ b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/listener/OnBlockBreak.java @@ -0,0 +1,14 @@ +package eu.ruekov.ruakij.LinkedBeaconTeleporters.listener; + +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.block.BlockBreakEvent; + +public class OnBlockBreak implements Listener { + + @EventHandler(priority = EventPriority.LOW) + public void onBlockBreakEvent(BlockBreakEvent e){ + + } +} diff --git a/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/listener/OnBlockPlace.java b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/listener/OnBlockPlace.java new file mode 100644 index 0000000..c7eddaa --- /dev/null +++ b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/listener/OnBlockPlace.java @@ -0,0 +1,16 @@ +package eu.ruekov.ruakij.LinkedBeaconTeleporters.listener; + +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; + +public class OnBlockPlace implements Listener { + + @EventHandler(priority = EventPriority.LOW) + public void onBlockPlaceEvent(BlockPlaceEvent e){ + + } +} diff --git a/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/listener/OnPrepareItemCraftEvent.java b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/listener/OnPrepareItemCraftEvent.java new file mode 100644 index 0000000..045014e --- /dev/null +++ b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/listener/OnPrepareItemCraftEvent.java @@ -0,0 +1,18 @@ +package eu.ruekov.ruakij.LinkedBeaconTeleporters.listener; + +import org.bukkit.Material; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.inventory.PrepareItemCraftEvent; +import org.bukkit.inventory.CraftingInventory; +import org.bukkit.inventory.InventoryView; +import org.bukkit.inventory.ItemStack; + +public class OnPrepareItemCraftEvent implements Listener { + + @EventHandler(priority = EventPriority.LOW) + public void onPrepareItemCraftEvent(CraftingInventory what, InventoryView view, boolean isRepair){ + + } +}