From 4b01ecadd6a48e768ab458a6acfd52cb07bc93df Mon Sep 17 00:00:00 2001 From: LoneDev6 Date: Wed, 31 May 2023 14:53:20 +0200 Subject: [PATCH] Added Campfire events --- pom.xml | 2 +- .../api/Events/campfire/CampfireLitEvent.java | 54 ++++++++++++++ .../Events/campfire/CampfirePutItemEvent.java | 73 +++++++++++++++++++ .../campfire/CampfireRemoveItemEvent.java | 68 +++++++++++++++++ .../Events/campfire/CampfireUnlitEvent.java | 54 ++++++++++++++ 5 files changed, 250 insertions(+), 1 deletion(-) create mode 100644 src/main/java/dev/lone/itemsadder/api/Events/campfire/CampfireLitEvent.java create mode 100644 src/main/java/dev/lone/itemsadder/api/Events/campfire/CampfirePutItemEvent.java create mode 100644 src/main/java/dev/lone/itemsadder/api/Events/campfire/CampfireRemoveItemEvent.java create mode 100644 src/main/java/dev/lone/itemsadder/api/Events/campfire/CampfireUnlitEvent.java diff --git a/pom.xml b/pom.xml index bc2eeb2..3e2e40e 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ dev.lone api-itemsadder - 3.4.1d + 3.4.1e UTF-8 diff --git a/src/main/java/dev/lone/itemsadder/api/Events/campfire/CampfireLitEvent.java b/src/main/java/dev/lone/itemsadder/api/Events/campfire/CampfireLitEvent.java new file mode 100644 index 0000000..6d92dad --- /dev/null +++ b/src/main/java/dev/lone/itemsadder/api/Events/campfire/CampfireLitEvent.java @@ -0,0 +1,54 @@ +package dev.lone.itemsadder.api.Events.campfire; + +import org.bukkit.block.Campfire; +import org.bukkit.entity.Player; +import org.bukkit.event.Cancellable; +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; +import org.jetbrains.annotations.NotNull; + +@SuppressWarnings("unused") +public class CampfireLitEvent extends Event implements Cancellable +{ + private static final HandlerList HANDLERS = new HandlerList(); + + boolean isCancelled; + final Campfire campfire; + final Player player; + + public CampfireLitEvent(@NotNull Campfire campfire, + @NotNull Player player) + { + this.campfire = campfire; + this.player = player; + } + + @NotNull + @Override + public HandlerList getHandlers() + { + return HANDLERS; + } + + @Override + public boolean isCancelled() + { + return this.isCancelled; + } + + @Override + public void setCancelled(boolean b) + { + this.isCancelled = b; + } + + public Campfire getCampfire() + { + return campfire; + } + + public Player getPlayer() + { + return player; + } +} \ No newline at end of file diff --git a/src/main/java/dev/lone/itemsadder/api/Events/campfire/CampfirePutItemEvent.java b/src/main/java/dev/lone/itemsadder/api/Events/campfire/CampfirePutItemEvent.java new file mode 100644 index 0000000..2ac317f --- /dev/null +++ b/src/main/java/dev/lone/itemsadder/api/Events/campfire/CampfirePutItemEvent.java @@ -0,0 +1,73 @@ +package dev.lone.itemsadder.api.Events.campfire; + +import org.bukkit.block.Campfire; +import org.bukkit.entity.Player; +import org.bukkit.event.Cancellable; +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; +import org.bukkit.inventory.ItemStack; +import org.jetbrains.annotations.NotNull; + +@SuppressWarnings("unused") +public class CampfirePutItemEvent extends Event implements Cancellable +{ + private static final HandlerList HANDLERS = new HandlerList(); + + boolean isCancelled; + final Player player; + ItemStack item; + Campfire campfire; + + public CampfirePutItemEvent(@NotNull Campfire campfire, + @NotNull ItemStack item, + @NotNull Player player) + { + this.campfire = campfire; + this.item = item; + this.player = player; + } + + @NotNull + @Override + public HandlerList getHandlers() + { + return HANDLERS; + } + + @Override + public boolean isCancelled() + { + return this.isCancelled; + } + + @Override + public void setCancelled(boolean b) + { + this.isCancelled = b; + } + + public static HandlerList getHandlerList() + { + return HANDLERS; + } + + public Player getPlayer() + { + return player; + } + + public ItemStack getItem() + { + return item; + } + + public void setItem(ItemStack item) + { + this.item = item; + } + + public Campfire getCampfire() + { + return campfire; + } +} \ No newline at end of file diff --git a/src/main/java/dev/lone/itemsadder/api/Events/campfire/CampfireRemoveItemEvent.java b/src/main/java/dev/lone/itemsadder/api/Events/campfire/CampfireRemoveItemEvent.java new file mode 100644 index 0000000..fe34b8e --- /dev/null +++ b/src/main/java/dev/lone/itemsadder/api/Events/campfire/CampfireRemoveItemEvent.java @@ -0,0 +1,68 @@ +package dev.lone.itemsadder.api.Events.campfire; + +import org.bukkit.block.Campfire; +import org.bukkit.entity.Player; +import org.bukkit.event.Cancellable; +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; +import org.bukkit.inventory.ItemStack; +import org.jetbrains.annotations.NotNull; + +@SuppressWarnings("unused") +public class CampfireRemoveItemEvent extends Event implements Cancellable +{ + private static final HandlerList HANDLERS = new HandlerList(); + + boolean isCancelled; + final Player player; + final ItemStack item; + Campfire campfire; + + public CampfireRemoveItemEvent(@NotNull Campfire campfire, + @NotNull ItemStack item, + @NotNull Player player) + { + this.campfire = campfire; + this.item = item; + this.player = player; + } + + @NotNull + @Override + public HandlerList getHandlers() + { + return HANDLERS; + } + + @Override + public boolean isCancelled() + { + return this.isCancelled; + } + + @Override + public void setCancelled(boolean b) + { + this.isCancelled = b; + } + + public static HandlerList getHandlerList() + { + return HANDLERS; + } + + public Player getPlayer() + { + return player; + } + + public ItemStack getItem() + { + return item; + } + + public Campfire getCampfire() + { + return campfire; + } +} \ No newline at end of file diff --git a/src/main/java/dev/lone/itemsadder/api/Events/campfire/CampfireUnlitEvent.java b/src/main/java/dev/lone/itemsadder/api/Events/campfire/CampfireUnlitEvent.java new file mode 100644 index 0000000..3747198 --- /dev/null +++ b/src/main/java/dev/lone/itemsadder/api/Events/campfire/CampfireUnlitEvent.java @@ -0,0 +1,54 @@ +package dev.lone.itemsadder.api.Events.campfire; + +import org.bukkit.block.Campfire; +import org.bukkit.entity.Player; +import org.bukkit.event.Cancellable; +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; +import org.jetbrains.annotations.NotNull; + +@SuppressWarnings("unused") +public class CampfireUnlitEvent extends Event implements Cancellable +{ + private static final HandlerList HANDLERS = new HandlerList(); + + boolean isCancelled; + final Campfire campfire; + final Player player; + + public CampfireUnlitEvent(@NotNull Campfire campfire, + @NotNull Player player) + { + this.campfire = campfire; + this.player = player; + } + + @NotNull + @Override + public HandlerList getHandlers() + { + return HANDLERS; + } + + @Override + public boolean isCancelled() + { + return this.isCancelled; + } + + @Override + public void setCancelled(boolean b) + { + this.isCancelled = b; + } + + public Campfire getCampfire() + { + return campfire; + } + + public Player getPlayer() + { + return player; + } +} \ No newline at end of file