From 5f08fccb9aab1d8a76a4d2d8b863c8ee106b89c0 Mon Sep 17 00:00:00 2001 From: Trever Fischer Date: Mon, 23 Apr 2012 16:41:48 -0400 Subject: [PATCH] Implement a basic Region event --- .../java/us/camin/regions/RegionEvent.java | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 src/main/java/us/camin/regions/RegionEvent.java diff --git a/src/main/java/us/camin/regions/RegionEvent.java b/src/main/java/us/camin/regions/RegionEvent.java new file mode 100644 index 0000000..943eeaf --- /dev/null +++ b/src/main/java/us/camin/regions/RegionEvent.java @@ -0,0 +1,47 @@ +package us.camin.regions; + +/** + * This file is part of Regions + * + * Regions is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Regions is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Regions. If not, see . + * + */ + +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; + +public class RegionEvent extends Event { + private static final HandlerList s_handlers = new HandlerList(); + public final EventType type; + public final Region region; + + public enum EventType { + Added, + Removed + } + + public RegionEvent(Region region, EventType type) { + this.region = region; + this.type = type; + } + + @Override + public HandlerList getHandlers() { + return s_handlers; + } + + public static HandlerList getHandlerList() { + return s_handlers; + } +}