question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot use addons as API

See original GitHub issue

Description We cannot use any code from the addons as an API. I tried to use the IslandLevelCalculatedEvent, but once i try, i get a NoClassDefError, prolly because only your custom ClassLoader knows about this class, and not the normal JVM one. Would you know how to get around this problem ? For now i moved the event from addon-level to bentobox to fix this issue locally so i can continue working.

Steps to reproduce the behavior: Example code :

import bentobox.addon.level.event.IslandLevelCalculatedEvent;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;

import java.util.LinkedList;
import java.util.List;

public class IslandListener implements Listener
{
    @EventHandler
    public void onIslandLevelChange(IslandLevelCalculatedEvent event)
    {
        // Code
    }
}

Expected behavior Be able to use the event

Screenshots /

Server Information:

  • Database being used (Flat file, MySQL, Mongo): Flat file
  • OS: Debian 8
  • Java Version: Java 8 (191)
  • BentoBox version: 0.14.1
  • Addons installed? BSkyBlock 0.5.0-SNAPSHOT, BentoBox-Challenges 0.2.0-SNAPSHOT, Level 0.1.0-SNAPSHOT
  • Other plugins? Only the one i’m developing

Additional context Note : This class is definitely loaded after Bentobox and its addons are fully enabled

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
tastybentocommented, Dec 9, 2018

Okay, I added another key-value pair to reference the underlying event. I did play with overriding the getEventName() method from Event, but that would cause the AddonEvent itself not to have a correct name. Anyway, this way the underlying event can be understood.

0reactions
tastybentocommented, Dec 5, 2018

@Poslovitch @PSNRigner Okay, I’ll look at this again this weekend.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot use addons as API · Issue #352 - GitHub
We cannot use any code from the addons as an API. I tried to use the IslandLevelCalculatedEvent, but once i try, i get...
Read more >
A new API for submitting and updating add-ons
The new add-on submission api aims to overcome these limitations and (eventually) allow developers to submit and manage all parts of their add- ......
Read more >
Using add-ons | Apps Script - Google Developers
This documentation section describes how users can install, authorize and start using Google Workspace add-ons. Installing add-ons. Before you ...
Read more >
Add-ons — addons-server documentation - Read the Docs
Currently only compatible with language packs through the add-on detail API, ignored for other types of add-ons and APIs.
Read more >
Microsoft Store API : Cannot create promo code for addon type ...
It is not possible to generate promotional codes for subscription add-ons. This is mentioned on the document - Generate promotional codes ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found