From 364c687e16d21f849141fe163b6b5b031e5fcb27 Mon Sep 17 00:00:00 2001 From: Shevchik Date: Fri, 7 Mar 2014 09:17:39 +0400 Subject: [PATCH] Add events classes --- .../chairs/core/api/PlayerChairSitEvent.java | 36 +++++++++++++++++++ .../core/api/PlayerChairUnsitEvent.java | 36 +++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 src/com/cnaude/chairs/core/api/PlayerChairSitEvent.java create mode 100644 src/com/cnaude/chairs/core/api/PlayerChairUnsitEvent.java diff --git a/src/com/cnaude/chairs/core/api/PlayerChairSitEvent.java b/src/com/cnaude/chairs/core/api/PlayerChairSitEvent.java new file mode 100644 index 0000000..177edeb --- /dev/null +++ b/src/com/cnaude/chairs/core/api/PlayerChairSitEvent.java @@ -0,0 +1,36 @@ +package com.cnaude.chairs.core.api; + +import org.bukkit.entity.Player; +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; +import org.bukkit.event.player.PlayerEvent; + +public class PlayerChairSitEvent extends PlayerEvent implements Cancellable { + + private static final HandlerList handlers = new HandlerList(); + private boolean cancelled = false; + + public PlayerChairSitEvent(Player who) { + super(who); + } + + @Override + public HandlerList getHandlers() { + return handlers; + } + + public static HandlerList getHandlerList() { + return handlers; + } + + @Override + public boolean isCancelled() { + return cancelled; + } + + @Override + public void setCancelled(boolean cancelled) { + this.cancelled = cancelled; + } + +} diff --git a/src/com/cnaude/chairs/core/api/PlayerChairUnsitEvent.java b/src/com/cnaude/chairs/core/api/PlayerChairUnsitEvent.java new file mode 100644 index 0000000..ebaf118 --- /dev/null +++ b/src/com/cnaude/chairs/core/api/PlayerChairUnsitEvent.java @@ -0,0 +1,36 @@ +package com.cnaude.chairs.core.api; + +import org.bukkit.entity.Player; +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; +import org.bukkit.event.player.PlayerEvent; + +public class PlayerChairUnsitEvent extends PlayerEvent implements Cancellable { + + private static final HandlerList handlers = new HandlerList(); + private boolean cancelled = false; + + public PlayerChairUnsitEvent(Player who) { + super(who); + } + + @Override + public HandlerList getHandlers() { + return handlers; + } + + public static HandlerList getHandlerList() { + return handlers; + } + + @Override + public boolean isCancelled() { + return cancelled; + } + + @Override + public void setCancelled(boolean cancelled) { + this.cancelled = cancelled; + } + +}