mirror of
https://github.com/EpicEricEE/ShopChest.git
synced 2024-11-28 21:45:47 +01:00
Update javadoc of events to match rest of API
This commit is contained in:
parent
34de6022e7
commit
ef6ef3dc1c
@ -7,6 +7,8 @@ import org.bukkit.event.Cancellable;
|
||||
|
||||
/**
|
||||
* Called when a player buys or sells something from or to a shop
|
||||
*
|
||||
* @since 1.13
|
||||
*/
|
||||
public class ShopBuySellEvent extends ShopEvent implements Cancellable {
|
||||
private Type type;
|
||||
@ -22,21 +24,30 @@ public class ShopBuySellEvent extends ShopEvent implements Cancellable {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Whether the player buys or sells something
|
||||
* Gets whether the type of transaction is a buy or a sell
|
||||
*
|
||||
* @return the type of transaction
|
||||
* @since 1.13
|
||||
*/
|
||||
public Type getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The amount which might be modified because of automatic item amount calculation
|
||||
* Gets the amount which might be modified because of automatic item amount calculation
|
||||
*
|
||||
* @return the amount
|
||||
* @since 1.13
|
||||
*/
|
||||
public int getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The price which might be modified because of automatic item amount calculation
|
||||
* Gets the price which might be modified because of automatic item amount calculation
|
||||
*
|
||||
* @return the price
|
||||
* @since 1.13
|
||||
*/
|
||||
public double getPrice() {
|
||||
return price;
|
||||
|
@ -5,7 +5,9 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
||||
/**
|
||||
* Called when a player creates a shop (clicks on a chest)
|
||||
* Called when a player clicks a chest to create a shop
|
||||
*
|
||||
* @since 1.13
|
||||
*/
|
||||
public class ShopCreateEvent extends ShopEvent implements Cancellable {
|
||||
private double creationPrice;
|
||||
@ -15,8 +17,14 @@ public class ShopCreateEvent extends ShopEvent implements Cancellable {
|
||||
super(player, shop);
|
||||
this.creationPrice = creationPrice;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The price the player has to pay in order to create the shop (only if the event is not cancelled)
|
||||
* Gets the price the player has to pay in order to create the shop
|
||||
* <p>
|
||||
* The price is only paid if the event is not cancelled.
|
||||
*
|
||||
* @return the creation price
|
||||
* @since 1.13
|
||||
*/
|
||||
public double getCreationPrice() {
|
||||
return creationPrice;
|
||||
|
@ -5,6 +5,11 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
/**
|
||||
* Represents a shop related event
|
||||
*
|
||||
* @since 1.13
|
||||
*/
|
||||
public abstract class ShopEvent extends Event {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
@ -17,14 +22,20 @@ public abstract class ShopEvent extends Event {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Shop which is involved in this event
|
||||
* Get the shop which is involved in this event
|
||||
*
|
||||
* @return the shop
|
||||
* @since 1.13
|
||||
*/
|
||||
public Shop getShop() {
|
||||
return shop;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Player who is involved in this event
|
||||
* Gets the player who is involved in this event
|
||||
*
|
||||
* @return the player
|
||||
* @since 1.13
|
||||
*/
|
||||
public Player getPlayer() {
|
||||
return player;
|
||||
|
@ -7,7 +7,9 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
||||
/**
|
||||
* Called when a player extends a shop (making a chest a double chest)
|
||||
* Called when a player extends a shop's chest to a double chest
|
||||
*
|
||||
* @since 1.13
|
||||
*/
|
||||
public class ShopExtendEvent extends ShopEvent implements Cancellable {
|
||||
private boolean cancelled;
|
||||
@ -19,7 +21,10 @@ public class ShopExtendEvent extends ShopEvent implements Cancellable {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Location of the placed chest
|
||||
* Gets the location of the placed chest
|
||||
*
|
||||
* @return the location of the placed chest
|
||||
* @since 1.13
|
||||
*/
|
||||
public Location getNewChestLocation() {
|
||||
return newChestLocation;
|
||||
|
@ -5,7 +5,9 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
||||
/**
|
||||
* Called when a player retrieves information about a shop (clicks on a chest)
|
||||
* Called when a player clicks a shop to retrieve information about it
|
||||
*
|
||||
* @since 1.13
|
||||
*/
|
||||
public class ShopInfoEvent extends ShopEvent implements Cancellable {
|
||||
private boolean cancelled;
|
||||
|
@ -3,6 +3,11 @@ package de.epiceric.shopchest.api.event;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
/**
|
||||
* Called after all shops are initialized after the plugin is enabled
|
||||
*
|
||||
* @since 1.13
|
||||
*/
|
||||
public class ShopInitializedEvent extends Event {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
@ -12,6 +17,12 @@ public class ShopInitializedEvent extends Event {
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the amount of shops that were initialized
|
||||
*
|
||||
* @return the amount of shops
|
||||
* @since 1.13
|
||||
*/
|
||||
public int getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
@ -5,7 +5,9 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
||||
/**
|
||||
* Called when a player opens a shop (clicks on a chest)
|
||||
* Called when a player clicks a shop to open it
|
||||
*
|
||||
* @since 1.13
|
||||
*/
|
||||
public class ShopOpenEvent extends ShopEvent implements Cancellable {
|
||||
private boolean cancelled;
|
||||
|
@ -8,7 +8,9 @@ import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
/**
|
||||
* Called when a player wants to create a shop (enters the command)
|
||||
* Called when a player enters the command to create a shop
|
||||
*
|
||||
* @since 1.13
|
||||
*/
|
||||
public class ShopPreCreateEvent extends Event implements Cancellable {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
@ -29,35 +31,50 @@ public class ShopPreCreateEvent extends Event implements Cancellable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the player who is involved in this event
|
||||
*
|
||||
* @return the player
|
||||
* @since 1.13
|
||||
*/
|
||||
public Player getPlayer() {
|
||||
return player;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the product the shop will sell or buy
|
||||
*
|
||||
* @return the product
|
||||
* @since 1.13
|
||||
*/
|
||||
public ShopProduct getProduct() {
|
||||
return product;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the buyPrice
|
||||
* Gets the price for which players will be able to buy from the shop
|
||||
*
|
||||
* @return the buy price
|
||||
* @since 1.13
|
||||
*/
|
||||
public double getBuyPrice() {
|
||||
return buyPrice;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the sellPrice
|
||||
* Gets the price for which players will be able to sell to the shop
|
||||
*
|
||||
* @return the sell price
|
||||
* @since 1.13
|
||||
*/
|
||||
public double getSellPrice() {
|
||||
return sellPrice;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the admin
|
||||
* Gets whether the shop will be an admin shop
|
||||
*
|
||||
* @return whether the shop will be an admin shop
|
||||
* @since 1.13
|
||||
*/
|
||||
public boolean isAdminShop() {
|
||||
return admin;
|
||||
|
@ -6,7 +6,9 @@ import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
/**
|
||||
* Called when a player wants to retrieve information about a shop (enters the command)
|
||||
* Called when a player enters the command to retrieve information about a shop
|
||||
*
|
||||
* @since 1.13
|
||||
*/
|
||||
public class ShopPreInfoEvent extends Event implements Cancellable {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
@ -19,7 +21,10 @@ public class ShopPreInfoEvent extends Event implements Cancellable {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Player who is involved in this event
|
||||
* Gets the player who is involved in this event
|
||||
*
|
||||
* @return the player
|
||||
* @since 1.13
|
||||
*/
|
||||
public Player getPlayer() {
|
||||
return player;
|
||||
|
@ -6,7 +6,9 @@ import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
/**
|
||||
* Called when a player wants to open a shop (enters the command)
|
||||
* Called when a player enters the command to open a shop
|
||||
*
|
||||
* @since 1.13
|
||||
*/
|
||||
public class ShopPreOpenEvent extends Event implements Cancellable {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
@ -19,7 +21,10 @@ public class ShopPreOpenEvent extends Event implements Cancellable {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Player who is involved in this event
|
||||
* Get the player who is involved in this event
|
||||
*
|
||||
* @return the player
|
||||
* @since 1.13
|
||||
*/
|
||||
public Player getPlayer() {
|
||||
return player;
|
||||
|
@ -6,7 +6,9 @@ import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
/**
|
||||
* Called when a player wants to remove a shop (enters the command)
|
||||
* Called when a player enters the command to remove a shop
|
||||
*
|
||||
* @since 1.13
|
||||
*/
|
||||
public class ShopPreRemoveEvent extends Event implements Cancellable {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
@ -19,7 +21,10 @@ public class ShopPreRemoveEvent extends Event implements Cancellable {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Player who is involved in this event
|
||||
* Gets the player who is involved in this event
|
||||
*
|
||||
* @return the player
|
||||
* @since 1.13
|
||||
*/
|
||||
public Player getPlayer() {
|
||||
return player;
|
||||
|
@ -6,7 +6,9 @@ import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
/**
|
||||
* Called when a player reloads the shops
|
||||
* Called when the shops are reloaded by a command
|
||||
*
|
||||
* @since 1.13
|
||||
*/
|
||||
public class ShopReloadEvent extends Event implements Cancellable {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
@ -19,7 +21,10 @@ public class ShopReloadEvent extends Event implements Cancellable {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Sender who triggered the reload
|
||||
* Gets the sender that entered the reload command
|
||||
*
|
||||
* @return the sender
|
||||
* @since 1.13
|
||||
*/
|
||||
public CommandSender getSender() {
|
||||
return sender;
|
||||
|
@ -9,6 +9,11 @@ import org.bukkit.event.HandlerList;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Called when a player enters the command to remove all shops of a player
|
||||
*
|
||||
* @since 1.13
|
||||
*/
|
||||
public class ShopRemoveAllEvent extends Event implements Cancellable {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
@ -23,14 +28,34 @@ public class ShopRemoveAllEvent extends Event implements Cancellable {
|
||||
this.shops = shops;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the sender that entered the reload command
|
||||
*
|
||||
* @return the sender
|
||||
* @since 1.13
|
||||
*/
|
||||
public CommandSender getSender() {
|
||||
return sender;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the player whose shops will be removed
|
||||
*
|
||||
* @return the vendor
|
||||
* @since 1.13
|
||||
*/
|
||||
public OfflinePlayer getVendor() {
|
||||
return vendor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the shops that will be removed
|
||||
* <p>
|
||||
* This list can be modified to include or exclude certain shops.
|
||||
*
|
||||
* @return a modifiable list of shops
|
||||
* @since 1.13
|
||||
*/
|
||||
public List<Shop> getShops() {
|
||||
return shops;
|
||||
}
|
||||
|
@ -5,7 +5,9 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
||||
/**
|
||||
* Called when a player removes a shop (clicks on a chest)
|
||||
* Called when a player enters the command to remove a shop
|
||||
*
|
||||
* @since 1.13
|
||||
*/
|
||||
public class ShopRemoveEvent extends ShopEvent implements Cancellable {
|
||||
private boolean cancelled;
|
||||
|
Loading…
Reference in New Issue
Block a user