Added global API.getActionManager()

This commit is contained in:
bigguy345 committed 2025-06-28 10:06:14 +03:00
1 parent 6de09c1ee4
commit e001beb6ba
3 files changed
+16 -2

No files matched your search

@@ -79,6 +79,7 @@ public class NpcAPI extends AbstractNpcAPI {
private static final CacheHashMap<ItemStack, CacheHashMap.CachedObject<ScriptItemStack>> scriptItemCache = new CacheHashMap<>(60 * 1000);
public static final HashMap<String, Object> engineObjects = new HashMap<>();
public static final EventBus EVENT_BUS = new EventBus();
public static final ScriptedActionManager actionManager = new ScriptedActionManager();
private static AbstractNpcAPI instance = null;
private final static String API_USER_AGENT = "CNPC+API";
@@ -559,6 +560,10 @@ public class NpcAPI extends AbstractNpcAPI {
return container instanceof ContainerNpcInterface ? ContainerNpcInterface.getOrCreateIContainer((ContainerNpcInterface) container) : new ScriptContainer(container);
}
public IActionManager getActionManager() {
return actionManager;
}
private void checkWorld() {
if (CustomNpcs.getServer() == null || CustomNpcs.getServer().isServerStopped()) {
throw new CustomNPCsException("No world is loaded right now");