It would be great to add ShopCreate and ShopDelete events. Right now there is no way to get real-time updates without waiting out the one hour cooldown on the shop endpoint. Something like this:
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onShopCreate(ShopCreateEvent event) {
Shop shop = event.shop().orElse(null);
if (shop == null) {
return;
}
UUID owner = shop.getOwner().getUniqueId();
if (owner == null ) {
return;
}
JsonObject message = new JsonObject();
message.add("shop", EndpointUtils.getShopObject(shop));
sse.sendEvent("ShopCreated", message, owner);
}
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onShopDelete(ShopDeleteEvent event) {
Shop shop = event.shop().orElse(null);
if (shop == null) {
return;
}
UUID owner = shop.getOwner().getUniqueId();
if (owner == null ) {
return;
}
JsonObject message = new JsonObject();
message.add("shop", EndpointUtils.getShopObject(shop));
sse.sendEvent("ShopDeleted", message, owner);
}
It would be great to add ShopCreate and ShopDelete events. Right now there is no way to get real-time updates without waiting out the one hour cooldown on the shop endpoint. Something like this: