Skip to content

Commit

Permalink
Added Campfire events
Browse files Browse the repository at this point in the history
  • Loading branch information
LoneDev6 committed May 31, 2023
1 parent bdfc5e3 commit 4b01eca
Show file tree
Hide file tree
Showing 5 changed files with 250 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<groupId>dev.lone</groupId>
<artifactId>api-itemsadder</artifactId>
<version>3.4.1d</version>
<version>3.4.1e</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
}
}
Original file line number Diff line number Diff line change
@@ -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;
}
}
Original file line number Diff line number Diff line change
@@ -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;
}
}
Original file line number Diff line number Diff line change
@@ -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;
}
}

0 comments on commit 4b01eca

Please sign in to comment.