Extra methods to get shops

This commit is contained in:
Niels Vergucht 2019-01-01 16:41:04 +01:00
parent 5c5ed84b65
commit 711ca8035d
3 changed files with 16 additions and 1 deletions

View File

@ -106,6 +106,13 @@ public class Shop {
return subShops.get(shop);
}
public SubShop getSubShop(XMaterial mat) {
for (SubShop subShop : subShops.values()) {
if (subShop.getGenItem().isSimilar(mat.parseItem())) return subShop;
}
return null;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}

View File

@ -1,6 +1,7 @@
package com.songoda.epicbuckets.shop;
import com.songoda.epicbuckets.EpicBuckets;
import com.songoda.epicbuckets.genbucket.GenbucketType;
import com.songoda.epicbuckets.util.*;
import org.bukkit.Bukkit;
import org.bukkit.configuration.file.FileConfiguration;
@ -134,6 +135,13 @@ public class ShopManager {
return shopDatabase.get(shop);
}
public Shop getShop(GenbucketType genbucketType) {
for (Shop shop : shopDatabase.values()) {
if (shop.getTrait() == genbucketType) return shop;
}
return null;
}
public String getShopPath() {
return shopPath;
}

View File

@ -1,5 +1,5 @@
name: EpicBuckets
version: 1.1
version: 1.4
description: Generate walls fast and efficient with beautiful guis!
author: Songoda
main: com.songoda.epicbuckets.EpicBuckets