Remove API module

This commit is contained in:
Len
2022-08-07 17:28:38 +02:00
parent aeb6d79495
commit 5ccd5b6f0c
34 changed files with 88 additions and 263 deletions
@@ -0,0 +1,31 @@
package com.alttd.playershops.events;
import com.alttd.playershops.shop.AbstractShop;
import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
public class PlayerCreateShopEvent extends ShopEvent {
private static final HandlerList handlers = new HandlerList();
private final Player player;
public PlayerCreateShopEvent(Player player, AbstractShop shop) {
super(shop);
this.player = player;
}
public Player getPlayer() {
return player;
}
@NotNull
@Override
public HandlerList getHandlers() {
return handlers;
}
@NotNull
public static HandlerList getHandlerList() {
return handlers;
}
}
@@ -0,0 +1,32 @@
package com.alttd.playershops.events;
import com.alttd.playershops.shop.AbstractShop;
import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
public class PlayerDestroyShopEvent extends ShopEvent {
private static final HandlerList handlers = new HandlerList();
private final Player player;
public PlayerDestroyShopEvent(Player player, AbstractShop shop) {
super(shop);
this.player = player;
}
public Player getPlayer() {
return player;
}
@NotNull
@Override
public HandlerList getHandlers() {
return handlers;
}
@NotNull
public static HandlerList getHandlerList() {
return handlers;
}
}
@@ -0,0 +1,32 @@
package com.alttd.playershops.events;
import com.alttd.playershops.shop.AbstractShop;
import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
public class PlayerExchangeShopEvent extends ShopEvent {
private static final HandlerList handlers = new HandlerList();
private final Player player;
public PlayerExchangeShopEvent(Player player, AbstractShop shop) {
super(shop);
this.player = player;
}
public Player getPlayer() {
return player;
}
@NotNull
@Override
public HandlerList getHandlers() {
return handlers;
}
@NotNull
public static HandlerList getHandlerList() {
return handlers;
}
}
@@ -0,0 +1,32 @@
package com.alttd.playershops.events;
import com.alttd.playershops.shop.AbstractShop;
import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
public class PlayerInitializeShopEvent extends ShopEvent {
private static final HandlerList handlers = new HandlerList();
private final Player player;
public PlayerInitializeShopEvent(Player player, AbstractShop shop) {
super(shop);
this.player = player;
}
public Player getPlayer() {
return player;
}
@NotNull
@Override
public HandlerList getHandlers() {
return handlers;
}
@NotNull
public static HandlerList getHandlerList() {
return handlers;
}
}
@@ -0,0 +1,41 @@
package com.alttd.playershops.events;
import com.alttd.playershops.shop.AbstractShop;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
public class ShopBalanceChangeEvent extends ShopEvent {
private static final HandlerList handlers = new HandlerList();
private final ChangeReason changeReason;
public ShopBalanceChangeEvent(AbstractShop shop, ChangeReason reason) {
super(shop);
this.changeReason = reason;
}
@NotNull
@Override
public HandlerList getHandlers() {
return handlers;
}
@NotNull
public static HandlerList getHandlerList() {
return handlers;
}
public ChangeReason getChangeReason() {
return changeReason;
}
public enum ChangeReason {
DEPOSIT,
WIDRAW,
SELL,
BUY,
UPKEEP
}
}
@@ -0,0 +1,30 @@
package com.alttd.playershops.events;
import com.alttd.playershops.shop.AbstractShop;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
public abstract class ShopEvent extends Event implements Cancellable {
private boolean cancelled;
private final AbstractShop shop;
public ShopEvent(AbstractShop shop) {
this.shop = shop;
}
public AbstractShop getShop() {
return shop;
}
@Override
public boolean isCancelled() {
return cancelled;
}
@Override
public void setCancelled(boolean b) {
this.cancelled = true;
}
}