Added ShopInitializedEvent

This commit is contained in:
Eric 2017-06-02 14:17:08 +02:00
parent 0f1d68e0c1
commit b455db4172
2 changed files with 29 additions and 0 deletions

View File

@ -6,6 +6,7 @@ import com.wasteofplastic.askyblock.ASkyBlock;
import de.epiceric.shopchest.config.Config; import de.epiceric.shopchest.config.Config;
import de.epiceric.shopchest.config.HologramFormat; import de.epiceric.shopchest.config.HologramFormat;
import de.epiceric.shopchest.config.Placeholder; import de.epiceric.shopchest.config.Placeholder;
import de.epiceric.shopchest.event.ShopInitializedEvent;
import de.epiceric.shopchest.external.PlotSquaredShopFlag; import de.epiceric.shopchest.external.PlotSquaredShopFlag;
import de.epiceric.shopchest.language.LanguageUtils; import de.epiceric.shopchest.language.LanguageUtils;
import de.epiceric.shopchest.language.LocalizedMessage; import de.epiceric.shopchest.language.LocalizedMessage;
@ -378,6 +379,7 @@ public class ShopChest extends JavaPlugin {
public void onResult(Object result) { public void onResult(Object result) {
if (result instanceof Integer) { if (result instanceof Integer) {
int count = (int) result; int count = (int) result;
Bukkit.getServer().getPluginManager().callEvent(new ShopInitializedEvent(count));
getLogger().info("Initialized " + count + " Shops"); getLogger().info("Initialized " + count + " Shops");
debug("Initialized " + count + " Shops"); debug("Initialized " + count + " Shops");
} }

View File

@ -0,0 +1,27 @@
package de.epiceric.shopchest.event;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
public class ShopInitializedEvent extends Event {
private static final HandlerList handlers = new HandlerList();
private int amount;
public ShopInitializedEvent(int amount) {
this.amount = amount;
}
public int getAmount() {
return amount;
}
public static HandlerList getHandlerList() {
return handlers;
}
@Override
public HandlerList getHandlers() {
return handlers;
}
}