NEW Discord webhooks (fully working including batchmode or instant mode
NEW Public API (shade jar into your plugin as lib and use reflection. See below for list of api methods and examples.
IMPROVED Fixed a bug with migration from plugin Shop (
https://www.spigotmc.org/resources/shop-the-intuitive-shop-plugin.9628/) caused by the owner storing the location of shops not as the container but the sign... and in the wrong format... and not always the same depending on what side the container is facing.
Seriously, just avoid that plugin, its utter dog****...
API:
Code (YAML):
Available methods: getAllShops
() - Get
all registered shops
getShopById
(long
) - Get shop by ID
getShopAt
(Location
) - Get shop at location
getShopsByOwner
(UUID
) - Get
all shops by owner
getShopCount
(UUID
) - Count shops owned by player
isShop
(Location
) - Check if location has a shop
getMaxShopsFor
(Player
) - Get max shops for player
setEconomyProvider
(Economy
) - Set custom economy
getEconomyProvider
() - Get current economy
firePrePurchaseEvent
(...) - Fire purchase event
firePreSellEvent
(...) - Fire sell event
getVersion
() - Get plugin version
isPremium
() - Check if premium
getPlugin
() - Get raw plugin instance
// TinyMarkets is a Paper plugin, so it may not be enabled yet when this Bukkit plugin enables. // We need to wait for the server to finish loading, then check for TinyMarkets. getLogger
().
info("Waiting for TinyMarkets to be available...");
// Schedule a delayed task to hook into TinyMarkets after server is fully loaded new BukkitRunnable
(){ privateint attempts
=0; privatefinalint maxAttempts
=20;// Try for 10 seconds (20 * 10 ticks = 200 ticks = 10 seconds)
@Override
publicvoid run
(){ attempts
++;
// Check if TinyMarkets API is available if(TinyMarketsAPI.
isAvailable()){ tinyMarketsAPI
= TinyMarketsAPI.
getInstance(); hooked
=true;
// If we've exceeded max attempts, give up if(attempts
>= maxAttempts
){ getLogger
().
warning("TinyMarkets API not available after "+ maxAttempts
+" attempts. MarketsHooker will not function."); getLogger
().
warning("Please ensure TinyMarkets is installed and enabled."); this.
cancel(); } } }.
runTaskTimer(this, 10L, 10L
);// Start after 10 ticks, repeat every 10 ticks (0.5 seconds) }
@Override
publicvoid onDisable
(){ getLogger
().
info("MarketsHooker disabled!"+(hooked
?" (was hooked to TinyMarkets)":" (was not hooked)")); }