Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to use this? #191

Open
creamgod45 opened this issue Sep 5, 2021 · 2 comments
Open

how to use this? #191

creamgod45 opened this issue Sep 5, 2021 · 2 comments

Comments

@creamgod45
Copy link

Put it inside your plugin jar, initialize an InventoryManager in your plugin (don't forget to call the init() method), and add a .manager(invManager) to your SmartInventory Builders.
what do you mean ?

java.lang.NoClassDefFoundError: Could not initialize class cg.creamgod45.SimpleInventory
        at cg.creamgod45.CG_ignoregui.onEnable(CG_ignoregui.java:26) ~[CG_ignoregui.jar:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[patched_1.17.1.jar:git-Purpur-1372]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[patched_1.17.1.jar:git-Purpur-1372]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:500) ~[patched_1.17.1.jar:git-Purpur-1372]
        at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugin(CraftServer.java:535) ~[patched_1.17.1.jar:git-Purpur-1372]
        at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugins(CraftServer.java:449) ~[patched_1.17.1.jar:git-Purpur-1372]
        at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:288) ~[patched_1.17.1.jar:git-Purpur-1372]
        at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1216) ~[patched_1.17.1.jar:git-Purpur-1372]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:321) ~[patched_1.17.1.jar:git-Purpur-1372]
        at java.lang.Thread.run(Thread.java:831) [?:?]
@creamgod45
Copy link
Author

Caused by: java.lang.IllegalStateException: The manager of the SmartInventory.Builder must be set, or the SmartInvs should be loaded as a plugin.
at fr.minuskube.inv.SmartInventory$Builder.build(SmartInventory.java:163) ~[CG_ignoregui.jar:?]
at cg.creamgod45.SimpleInventory.(SimpleInventory.java:20) ~[CG_ignoregui.jar:?]
at cg.creamgod45.cmdgui.onCommand(cmdgui.java:15) ~[CG_ignoregui.jar:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[patched_1.17.1.jar:git-Purpur-1372]
... 21 more

@MinusKube
Copy link
Owner

Do something like this inside your main class:

private InventoryManager invManager;

@Override
public void onEnable() {
    this.invManager = new InventoryManager(this);
    this.invManager.init();
}

Then, when creating your inventory:

SmartInventory.builder()
    .size(...)
    .manager(invManager)
    ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants