mirror of
https://github.com/amalthea-mc/ShopChest.git
synced 2024-11-22 10:22:29 +00:00
Added javadoc for events
This commit is contained in:
parent
99ab436346
commit
77f2476a70
@ -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 {
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
|
||||
@ -15,6 +18,9 @@ public class ShopPreInfoEvent 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 ShopPreInfoEvent extends Event implements Cancellable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean b) {
|
||||
this.cancelled = b;
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancelled = cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user