Split project

This commit is contained in:
Len
2022-07-09 14:53:27 +02:00
parent 259e806d59
commit bde0f5d040
25 changed files with 132 additions and 69 deletions
+23
View File
@@ -0,0 +1,23 @@
plugins {
`maven-publish`
}
dependencies {
compileOnly("com.alttd:Galaxy-API:1.18.2-R0.1-SNAPSHOT")
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
}
}
repositories{
maven {
name = "maven"
url = uri("https://repo.destro.xyz/snapshots")
credentials(PasswordCredentials::class)
}
}
}
@@ -0,0 +1,43 @@
package com.alttd.playershops.api;
import org.bukkit.Location;
import org.bukkit.inventory.ItemStack;
import java.util.UUID;
public interface Shop { // TODO finish docs
String getOwnerName();
UUID getOwnerUUID();
ShopType getType();
Location getSignLocation();
Location getContainerLocation();
String getServer();
double getPrice();
void setPrice(double price);
int getAmount();
void setAmount(int amount);
double getBalance();
void setBalance(double balance);
ItemStack getItemStack();
void setItemStack(ItemStack itemStack);
ItemStack getSecondaryItem();
void setSecondaryItem(ItemStack itemStack);
boolean isInitialized();
}
@@ -0,0 +1,71 @@
package com.alttd.playershops.api;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.UUID;
public interface ShopHandler { // TODO finish docs
/**
* Get the shop at a given location
*
* @param location Location of the shop
* @return Shop at the given location or <b>null</b> if no shop is found there
*/
Shop getShop(Location location);
/**
* Checks whether there is a shop at a given location
* @param location Location to check
* @return Whether there is a shop at the given location
*/
boolean isShop(Location location);
/**
* Get a collection of all loaded shops
*
* This collection is safe to use for looping over and removing shops.
*
* @return Read-only collection of all shops
*/
Collection<Shop> getShops();
/**
* Add a player's custom shop limit
*
* @param uuid The uuid linked to this player
* @param limit The new maximum amount of shops this player can have
*/
void addPlayerLimit(UUID uuid, int limit);
/**
* Get the maximum amount of shops this player is allowed to have
*
* @param uuid The uuid linked to this player
* @return The limit of shops for this player
*/
int getShopLimit(UUID uuid);
/**
* Checks wether this block is valid to be used as a shop
*
* @param block the block to check
* @return true if this block can be a shop
*/
boolean isShopMaterial(Block block);
/**
* Get all the shops owned by a player
*
* @param uuid The uuid linked to this player
* @return List of shops this player owns
*/
List<Shop> getShops(UUID uuid);
ArrayList<Material> getShopMaterials();
}
@@ -0,0 +1,15 @@
package com.alttd.playershops.api;
public enum ShopType {
SELL,
BUY,
GAMBLE,
BARTER;
@Override
public String toString() {
return name().toLowerCase();
}
}