From 77f2476a70bee24956d01ceaa32d8c5dee2d7c7a Mon Sep 17 00:00:00 2001 From: Eric Date: Wed, 6 Jul 2016 21:34:08 +0200 Subject: [PATCH] Added javadoc for events --- .../epiceric/shopchest/event/ShopBuySellEvent.java | 10 ++++++++-- .../de/epiceric/shopchest/event/ShopCreateEvent.java | 10 ++++++++-- .../java/de/epiceric/shopchest/event/ShopEvent.java | 6 ++++++ .../de/epiceric/shopchest/event/ShopInfoEvent.java | 7 +++++-- .../epiceric/shopchest/event/ShopPreCreateEvent.java | 8 ++++++-- .../epiceric/shopchest/event/ShopPreInfoEvent.java | 12 +++++++++--- .../epiceric/shopchest/event/ShopPreRemoveEvent.java | 10 ++++++++-- .../de/epiceric/shopchest/event/ShopReloadEvent.java | 10 ++++++++-- .../de/epiceric/shopchest/event/ShopRemoveEvent.java | 7 +++++-- 9 files changed, 63 insertions(+), 17 deletions(-) diff --git a/ShopChest/src/main/java/de/epiceric/shopchest/event/ShopBuySellEvent.java b/ShopChest/src/main/java/de/epiceric/shopchest/event/ShopBuySellEvent.java index aa7dc7e..e36cc30 100644 --- a/ShopChest/src/main/java/de/epiceric/shopchest/event/ShopBuySellEvent.java +++ b/ShopChest/src/main/java/de/epiceric/shopchest/event/ShopBuySellEvent.java @@ -4,6 +4,9 @@ import de.epiceric.shopchest.shop.Shop; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; +/** + * Called when a player buys or sells something from or to a shop + */ public class ShopBuySellEvent extends ShopEvent implements Cancellable { private Player player; private Shop shop; @@ -21,6 +24,9 @@ public class ShopBuySellEvent extends ShopEvent implements Cancellable { return shop; } + /** + * @return Whether the player buys or sells something + */ public Type getType() { return type; } @@ -36,8 +42,8 @@ public class ShopBuySellEvent extends ShopEvent implements Cancellable { } @Override - public void setCancelled(boolean b) { - cancelled = b; + public void setCancelled(boolean cancel) { + cancelled = cancel; } public enum Type { diff --git a/ShopChest/src/main/java/de/epiceric/shopchest/event/ShopCreateEvent.java b/ShopChest/src/main/java/de/epiceric/shopchest/event/ShopCreateEvent.java index 0036ac9..95f0a7a 100644 --- a/ShopChest/src/main/java/de/epiceric/shopchest/event/ShopCreateEvent.java +++ b/ShopChest/src/main/java/de/epiceric/shopchest/event/ShopCreateEvent.java @@ -4,6 +4,9 @@ import de.epiceric.shopchest.shop.Shop; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; +/** + * Called when a player creates a shop (clicks on a chest) + */ public class ShopCreateEvent extends ShopEvent implements Cancellable { private Player player; private Shop shop; @@ -26,6 +29,9 @@ public class ShopCreateEvent extends ShopEvent implements Cancellable { return player; } + /** + * @return The price the player has to pay in order to create the shop (only if the event is not cancelled) + */ public double getCreationPrice() { return creationPrice; } @@ -36,8 +42,8 @@ public class ShopCreateEvent extends ShopEvent implements Cancellable { } @Override - public void setCancelled(boolean b) { - cancelled = b; + public void setCancelled(boolean cancel) { + cancelled = cancel; } } diff --git a/ShopChest/src/main/java/de/epiceric/shopchest/event/ShopEvent.java b/ShopChest/src/main/java/de/epiceric/shopchest/event/ShopEvent.java index 96b1284..963ca8c 100644 --- a/ShopChest/src/main/java/de/epiceric/shopchest/event/ShopEvent.java +++ b/ShopChest/src/main/java/de/epiceric/shopchest/event/ShopEvent.java @@ -9,8 +9,14 @@ public abstract class ShopEvent extends Event { private static final HandlerList handlers = new HandlerList(); + /** + * @return Shop which is involved in this event + */ public abstract Shop getShop(); + /** + * @return Player who is involved in this event + */ public abstract Player getPlayer(); @Override diff --git a/ShopChest/src/main/java/de/epiceric/shopchest/event/ShopInfoEvent.java b/ShopChest/src/main/java/de/epiceric/shopchest/event/ShopInfoEvent.java index 6a654e2..c427161 100644 --- a/ShopChest/src/main/java/de/epiceric/shopchest/event/ShopInfoEvent.java +++ b/ShopChest/src/main/java/de/epiceric/shopchest/event/ShopInfoEvent.java @@ -4,6 +4,9 @@ import de.epiceric.shopchest.shop.Shop; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; +/** + * Called when a player retrieves information about a shop (clicks on a chest) + */ public class ShopInfoEvent extends ShopEvent implements Cancellable { private Player player; private Shop shop; @@ -30,7 +33,7 @@ public class ShopInfoEvent extends ShopEvent implements Cancellable { } @Override - public void setCancelled(boolean b) { - cancelled = b; + public void setCancelled(boolean cancel) { + cancelled = cancel; } } diff --git a/ShopChest/src/main/java/de/epiceric/shopchest/event/ShopPreCreateEvent.java b/ShopChest/src/main/java/de/epiceric/shopchest/event/ShopPreCreateEvent.java index 4dcb897..7851488 100644 --- a/ShopChest/src/main/java/de/epiceric/shopchest/event/ShopPreCreateEvent.java +++ b/ShopChest/src/main/java/de/epiceric/shopchest/event/ShopPreCreateEvent.java @@ -4,6 +4,9 @@ import de.epiceric.shopchest.shop.Shop; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; +/** + * Called when a player wants to create a shop (enters the command) + */ public class ShopPreCreateEvent extends ShopEvent implements Cancellable { private Player player; private Shop shop; @@ -14,6 +17,7 @@ public class ShopPreCreateEvent extends ShopEvent implements Cancellable { this.shop = shop; } + @Override public Player getPlayer() { return player; } @@ -29,7 +33,7 @@ public class ShopPreCreateEvent extends ShopEvent implements Cancellable { } @Override - public void setCancelled(boolean b) { - cancelled = b; + public void setCancelled(boolean cancel) { + cancelled = cancel; } } diff --git a/ShopChest/src/main/java/de/epiceric/shopchest/event/ShopPreInfoEvent.java b/ShopChest/src/main/java/de/epiceric/shopchest/event/ShopPreInfoEvent.java index ffd404e..0628c70 100644 --- a/ShopChest/src/main/java/de/epiceric/shopchest/event/ShopPreInfoEvent.java +++ b/ShopChest/src/main/java/de/epiceric/shopchest/event/ShopPreInfoEvent.java @@ -5,6 +5,9 @@ import org.bukkit.event.Cancellable; import org.bukkit.event.Event; import org.bukkit.event.HandlerList; +/** + * Called when a player wants to retrieve information about a shop (enters the command) + */ public class ShopPreInfoEvent extends Event implements Cancellable { private static final HandlerList handlers = new HandlerList(); @@ -14,7 +17,10 @@ public class ShopPreInfoEvent extends Event implements Cancellable { public ShopPreInfoEvent(Player player) { this.player = player; } - + + /** + * @return Player who is involved in this event + */ public Player getPlayer() { return player; } @@ -25,8 +31,8 @@ public class ShopPreInfoEvent extends Event implements Cancellable { } @Override - public void setCancelled(boolean b) { - this.cancelled = b; + public void setCancelled(boolean cancel) { + this.cancelled = cancel; } @Override diff --git a/ShopChest/src/main/java/de/epiceric/shopchest/event/ShopPreRemoveEvent.java b/ShopChest/src/main/java/de/epiceric/shopchest/event/ShopPreRemoveEvent.java index 6f67a76..1aa8f63 100644 --- a/ShopChest/src/main/java/de/epiceric/shopchest/event/ShopPreRemoveEvent.java +++ b/ShopChest/src/main/java/de/epiceric/shopchest/event/ShopPreRemoveEvent.java @@ -5,6 +5,9 @@ import org.bukkit.event.Cancellable; import org.bukkit.event.Event; import org.bukkit.event.HandlerList; +/** + * Called when a player wants to remove a shop (enters the command) + */ public class ShopPreRemoveEvent extends Event implements Cancellable { private static final HandlerList handlers = new HandlerList(); @@ -15,6 +18,9 @@ public class ShopPreRemoveEvent extends Event implements Cancellable { this.player = player; } + /** + * @return Player who is involved in this event + */ public Player getPlayer() { return player; } @@ -25,8 +31,8 @@ public class ShopPreRemoveEvent extends Event implements Cancellable { } @Override - public void setCancelled(boolean cancelled) { - this.cancelled = cancelled; + public void setCancelled(boolean cancel) { + cancelled = cancel; } @Override diff --git a/ShopChest/src/main/java/de/epiceric/shopchest/event/ShopReloadEvent.java b/ShopChest/src/main/java/de/epiceric/shopchest/event/ShopReloadEvent.java index 49b04a2..bbe3647 100644 --- a/ShopChest/src/main/java/de/epiceric/shopchest/event/ShopReloadEvent.java +++ b/ShopChest/src/main/java/de/epiceric/shopchest/event/ShopReloadEvent.java @@ -5,6 +5,9 @@ import org.bukkit.event.Cancellable; import org.bukkit.event.Event; import org.bukkit.event.HandlerList; +/** + * Called when a player reloads the shops + */ public class ShopReloadEvent extends Event implements Cancellable { private static final HandlerList handlers = new HandlerList(); @@ -15,6 +18,9 @@ public class ShopReloadEvent extends Event implements Cancellable { this.player = player; } + /** + * @return Player who is involved in this event + */ public Player getPlayer() { return player; } @@ -30,7 +36,7 @@ public class ShopReloadEvent extends Event implements Cancellable { } @Override - public void setCancelled(boolean b) { - cancelled = b; + public void setCancelled(boolean cancel) { + cancelled = cancel; } } diff --git a/ShopChest/src/main/java/de/epiceric/shopchest/event/ShopRemoveEvent.java b/ShopChest/src/main/java/de/epiceric/shopchest/event/ShopRemoveEvent.java index 1f7afb1..1e4c7d4 100644 --- a/ShopChest/src/main/java/de/epiceric/shopchest/event/ShopRemoveEvent.java +++ b/ShopChest/src/main/java/de/epiceric/shopchest/event/ShopRemoveEvent.java @@ -4,6 +4,9 @@ import de.epiceric.shopchest.shop.Shop; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; +/** + * Called when a player removes a shop (clicks on a chest) + */ public class ShopRemoveEvent extends ShopEvent implements Cancellable { private Player player; private Shop shop; @@ -30,7 +33,7 @@ public class ShopRemoveEvent extends ShopEvent implements Cancellable { } @Override - public void setCancelled(boolean b) { - cancelled = b; + public void setCancelled(boolean cancel) { + cancelled = cancel; } }