Giter Club home page Giter Club logo

helper's Introduction

helper Build Status Discord

helper is a development toolkit / library for Bukkit plugin developers. It provides a number of utilities and extended APIs which help to reduce boilerplate code and offer alternative paradigms for creating content.

History

💡 helper started off as a library to experiment with an alternative paradigm for creating event listeners. Over time, more functionality has been added, usually as a response to a specific development need as I completed freelance work.

🌍 I don't use helper in any of my public projects - it's quite a big library, and I don't like to add bloat unnecessarily!

✅ However, it has been used extensively in a number of private server projects, most notably, in most custom plugins on servers operated by Voldex Games (TheArchon, PrimeMC, etc). I'm also aware of a number of other developers / development teams who still actively use helper, which is awesome!

Status

I'm no longer actively working on further API additions, but the project is still being used frequently by various development teams, and I accept pull requests!

Links

  • Download (download links for the standalone helper plugins)
  • Wiki (almost-fully-complete documentation for helper)

Modules

helper: The main helper project

Artifact Maven Central Javadocs

helper-sql: Provides SQL datasources using HikariCP.

Artifact Maven Central Javadocs

helper-redis: Provides Redis clients and implements the helper Messaging system using Jedis.

Artifact Maven Central Javadocs

helper-mongo: Provides MongoDB datasources.

Artifact Maven Central Javadocs

helper-lilypad: Implements the helper Messaging system using LilyPad.

Artifact Maven Central Javadocs

helper-profiles: Provides a cached lookup service for player profiles.

Artifact Maven Central Javadocs

helper-js: JavaScript plugins using Nashorn.

Artifact Maven Central Javadocs

Feature Overview

  • Events - functional event handling and flexible listener registration
  • Scheduler - easy access to the Bukkit scheduler
  • Promise - a chain of operations (Futures) executing between both sync and async threads
  • Metadata - metadata with generic types, automatically expiring values and more
  • Messenger - message channel abstraction
  • Commands - create commands using the builder pattern
  • Scoreboard - asynchronous scoreboard using ProtocolLib
  • GUI - lightweight by highly adaptable and flexible menu abstraction
  • Menu Scheming - easily design menu layouts without having to worry about slot ids
  • Random - make random selections from collections of weighted elements
  • Bucket - sets of distributed and uniformly partitioned elements
  • Profiles - a lookup repository and cache for player uuid & name profiles
  • Plugin Annotations - automatically create plugin.yml files for your projects using annotations
  • Maven Annotations - download & install maven dependencies at runtime
  • Terminables - a family of interfaces to help easily manipulate objects which can be unregistered, stopped, or gracefully halted
  • Serialization - immutable and GSON compatible alternatives for common Bukkit objects
  • Bungee Messaging - wrapper for BungeeCord's plugin messaging API
  • JavaScript Plugins - javascript plugins using helper-js and Nashorn

... and much more!

helper's People

Contributors

anjoismysign avatar calumari avatar codehusky avatar connorruesch avatar dokanboy avatar dynamicfield avatar exloki avatar feelbetta avatar ferusgrim avatar iteije avatar joshy56 avatar lucko avatar mistert2525 avatar mrmicky-fr avatar notmyfault avatar okx-code avatar powercasgamer avatar revxrsal avatar russellbloxwich avatar sainttx avatar starryskye avatar theluca98 avatar uf0h avatar wi5e avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

helper's Issues

"Events" and "Commands" are no longer valid for Helper-JS

javax.script.ScriptException: ReferenceError: "Commands" is not defined in nashorn:mozilla_compat.js at line number 67 2018-02-15 14:28:17 [WARN] at jdk.nashorn.api.scripting.NashornScriptEngine.throwAsScriptException(NashornScriptEngine.java:470) 2018-02-15 14:28:17 [WARN] at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:454) 2018-02-15 14:28:17 [WARN] at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:406) 2018-02-15 14:28:17 [WARN] at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:402) 2018-02-15 14:28:17 [WARN] at jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:155) 2018-02-15 14:28:17 [WARN] at me.lucko.scriptcontroller.internal.ScriptImpl.run(ScriptImpl.java:162) 2018-02-15 14:28:17 [WARN] at me.lucko.scriptcontroller.internal.ScriptLoaderImpl.lambda$reload$1(ScriptLoaderImpl.java:294) 2018-02-15 14:28:17 [WARN] at me.lucko.helper.Scheduler$SchedulerWrappedRunnable.run(Scheduler.java:638) 2018-02-15 14:28:17 [WARN] at org.bukkit.craftbukkit.v1_12_R1.scheduler.CraftTask.run(CraftTask.java:71) 2018-02-15 14:28:17 [WARN] at org.bukkit.craftbukkit.v1_12_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:353) 2018-02-15 14:28:17 [WARN] at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:739) 2018-02-15 14:28:17 [WARN] at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:406) 2018-02-15 14:28:17 [WARN] at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:679) 2018-02-15 14:28:17 [WARN] at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:577) 2018-02-15 14:28:17 [WARN] at java.lang.Thread.run(Unknown Source) 2018-02-15 14:28:17 [WARN] Caused by: nashorn:mozilla_compat.js:67 ReferenceError: "Commands" is not defined 2018-02-15 14:28:17 [WARN] at jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:57) 2018-02-15 14:28:17 [WARN] at jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.java:319) 2018-02-15 14:28:17 [WARN] at jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.java:291) 2018-02-15 14:28:17 [WARN] at jdk.nashorn.internal.objects.Global.__noSuchProperty__(Global.java:1441) 2018-02-15 14:28:17 [WARN] at jdk.nashorn.internal.scripts.Script$Recompilation$9$1362A$\=nashorn\!mozilla_compat.value-1#__noSuchProperty__(nashorn:mozilla_compat.js:67) 2018-02-15 14:28:17 [WARN] at jdk.nashorn.internal.scripts.Script$17$gui.:program(plugins/helper-js/scripts/bin/lobby/gui.js:39) 2018-02-15 14:28:17 [WARN] at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:637) 2018-02-15 14:28:17 [WARN] at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:494) 2018-02-15 14:28:17 [WARN] at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393) 2018-02-15 14:28:17 [WARN] at jdk.nashorn.internal.runtime.Context.evaluateSource(Context.java:1222) 2018-02-15 14:28:17 [WARN] at jdk.nashorn.internal.runtime.Context.load(Context.java:839) 2018-02-15 14:28:17 [WARN] at jdk.nashorn.internal.objects.Global.load(Global.java:1545) 2018-02-15 14:28:17 [WARN] at jdk.nashorn.internal.scripts.Script$16$\^eval\_.:program(<eval>:1) 2018-02-15 14:28:17 [WARN] at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:637) 2018-02-15 14:28:17 [WARN] at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:494) 2018-02-15 14:28:17 [WARN] at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393) 2018-02-15 14:28:17 [WARN] at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:449) 2018-02-15 14:28:17 [WARN] ... 13 more

IllegalStateException when creating scoreboard

public void onPlayerJoinEvent(PlayerJoinEvent event) {
        val player = event.getPlayer();
        val playerData = Main.INSTANCE.getPlayerDataManager().registerPlayer(player);

        val scoreboardKey = MetadataKey.create("scoreboard", ScoreboardObjective.class);
        val scoreboard = Services.load(ScoreboardProvider.class).getScoreboard();

        val scoreboardObjective = scoreboard.createPlayerObjective(player, "null", DisplaySlot.SIDEBAR);
        Metadata.provideForPlayer(player).put(scoreboardKey, scoreboardObjective);

        Main.INSTANCE.getScoreboardManager().getUpdater().accept(player, scoreboardObjective);
    }

(mainly taken straight from the tutorial on the api page)
produced this error my console, with a scoreboard failing to be produced:

[06:32:22 ERROR]: [Core] [EVENTS] Exception thrown whilst handling event: org.bukkit.event.player.PlayerJoinEvent [06:32:22 WARN]: java.lang.IllegalStateException: No registration present for service 'me.lucko.helper.scoreboard.ScoreboardProvider' [06:32:22 WARN]: at me.lucko.helper.Services.lambda$load$0(Services.java:57) [06:32:22 WARN]: at java.util.Optional.orElseThrow(Optional.java:290) [06:32:22 WARN]: at me.lucko.helper.Services.load(Services.java:57) [06:32:22 WARN]: at me.devloper24.core.listener.impl.PlayerListener.onPlayerJoinEvent(PlayerListener.java:35) [06:32:22 WARN]: at me.lucko.helper.utils.Delegates$ConsumerToBiConsumerSecond.accept(Delegates.java:147) [06:32:22 WARN]: at me.lucko.helper.event.functional.single.HelperEventListener.execute(HelperEventListener.java:133) [06:32:22 WARN]: at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:78) [06:32:22 WARN]: at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) [06:32:22 WARN]: at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:517) [06:32:22 WARN]: at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:502) [06:32:22 WARN]: at net.minecraft.server.v1_8_R3.PlayerList.onPlayerJoin(PlayerList.java:314) [06:32:22 WARN]: at net.minecraft.server.v1_8_R3.PlayerList.a(PlayerList.java:173) [06:32:22 WARN]: at net.minecraft.server.v1_8_R3.LoginListener.b(LoginListener.java:144) [06:32:22 WARN]: at net.minecraft.server.v1_8_R3.LoginListener.c(LoginListener.java:54) [06:32:22 WARN]: at net.minecraft.server.v1_8_R3.NetworkManager.a(NetworkManager.java:231) [06:32:22 WARN]: at net.minecraft.server.v1_8_R3.ServerConnection.c(ServerConnection.java:148) [06:32:22 WARN]: at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:875) [06:32:22 WARN]: at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:378) [06:32:22 WARN]: at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:713) [06:32:22 WARN]: at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:616) [06:32:22 WARN]: at java.lang.Thread.run(Thread.java:748)
Any help would be appreciated.

Missing api-version in add-on modules

The main helper.jar correctly specifies api-version: 1.13 in the plugin.yml, but all the other modules are missing that property, forcing the server to load them in legacy mode unnecessarily.

(please help) having problem in my code

Description of the Bug

1.Hi Developers im new to coding. i tried to make this video uploading app to my firebase storage but im not that good at coding so im stuck at this problem. when upload button is pressed the filechooser is opened and if i select a file it gets uploaded to the firebase But if i cancel and close the filechooser it gives an error.
2. i am unaware if this file chooser works on android or nor...if it does not please help me with this code too. im stuck on this since 6 January ,thats how poor i am.

Code

from kivy.app import App
from kivy.lang import Builder

kv = '''
<MainScreen>:
    name: 'mainscreen'
    MDLabel:
        id:username_info
        text:'Hello Main'
        font_style:'H1'
        halign:'center'

    MDFloatLayout:
        id:floate
        Video:
            id:vid

        MDToolbar:
            title: 'Bottom navigation'
            md_bg_color: .2, .2, .2, 1
            specific_text_color: 1, 1, 1, 1
        MDBottomNavigation:
            panel_color: 1,1,1,1
            MDBottomNavigationItem:
                name: 'screen 1'
                text: 'Home'
                icon: 'home-outline'
                MDRaisedButton:
                    id:upload
                    text:'Upload'
                    pos_hint:{'center_x':.5, 'center_y':.4}
                    on_release:
                        app.file_chooser()
                        upload.disabled=False
'''


class goodApp(MDApp):

    def build(self):
        self.strng = Builder.load_string(help_str)
        self.url  = "link.json"
        return self.strng

    def file_chooser(self):
        filechooser.open_file(on_selection=self.selected)        
    def selected(self,selection):
        config={
              'Api keys of firebase'
        }

        firebase=pyrebase.initialize_app(config)
        storage=firebase.storage()            
        Directory=selection[0]
        Name=re.findall('[ \w-]+\..*',Directory)
        loginEmail = self.strng.get_screen('loginscreen').ids.login_email.text
        storage.child(str(f"{loginEmail}")).child(str(f"{Name}")).put(str(f"{Name[0]}"))

        if selection==True:
            self.root.ids.vid.source=firebase
            self.strng.get_screen('mainscreen').ids.upload.disabled=True
            self.strng.get_screen('mainscreen').manager.current ='uploadscreen'
            self.strng.get_screen('mainscreen').manager.transition.direction='left'            

        if selection==False:
            self.strng.get_screen('mainscreen').ids.upload.disabled=False



if __name__ == '__main__':
    goodApp().run()

Logs

[INFO ] [Logger ] Record log in C:\Users\Dheeraj.kivy\logs\kivy_22-01-19_1.txt
[INFO ] [deps ] Successfully imported "kivy_deps.angle" 0.3.0
[INFO ] [deps ] Successfully imported "kivy_deps.glew" 0.3.0
[INFO ] [deps ] Successfully imported "kivy_deps.sdl2" 0.3.1
[INFO ] [Kivy ] v2.0.0
[INFO ] [Kivy ] Installed at "C:\Users\Dheeraj\AppData\Roaming\Python\Python38\site-packages\kivy_init_.py"
[INFO ] [Python ] v3.8.10 (tags/v3.8.10:3d8993a, May 3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)]
[INFO ] [Python ] Interpreter at "C:\Users\Dheeraj\AppData\Local\Programs\Python\Python38\pythonw.exe"
[INFO ] [Factory ] 186 symbols loaded
[INFO ] [KivyMD ] 0.104.2, git-bc7d1f5, 2021-06-06 (installed at "C:\Users\Dheeraj\AppData\Local\Programs\Python\Python38\lib\site-packages\kivymd_init_.py")
[INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_pil (img_ffpyplayer ignored)
[INFO ] [Text ] Provider: sdl2
[INFO ] [Window ] Provider: sdl2
[INFO ] [GL ] Using the "OpenGL" graphics system
[INFO ] [GL ] GLEW initialization succeeded
[INFO ] [GL ] Backend used
[INFO ] [GL ] OpenGL version <b'2.1 Mesa 10.0.2 (git-675cd84)'>
[INFO ] [GL ] OpenGL vendor <b'VMware, Inc.'>
[INFO ] [GL ] OpenGL renderer <b'Gallium 0.4 on llvmpipe (LLVM 3.4, 128 bits)'>
[INFO ] [GL ] OpenGL parsed version: 2, 1
[INFO ] [GL ] Shading version <b'1.30'>
[INFO ] [GL ] Texture max size <8192>
[INFO ] [GL ] Texture max units <16>
[INFO ] [Window ] auto add sdl2 input provider
[INFO ] [Window ] virtual keyboard not allowed, single mode, not docked
[INFO ] [KivMob ] init called.
[WARNING] [KivMob ] Ads will not be shown.
[INFO ] [GL ] NPOT texture support is available
[INFO ] [Video ] Provider: null(['video_ffmpeg', 'video_ffpyplayer'] ignored)
[INFO ] [Base ] Start application main loop
Traceback (most recent call last):
File "C:\Users\Dheeraj\AppData\Roaming\Python\Python38\site-packages\plyer\platforms\win\filechooser.py", line 102, in run
self.fname, _, _ = win32gui.GetOpenFileNameW(**args)
pywintypes.error: (0, 'GetOpenFileNameW', 'No error message is available')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Dheeraj\AppData\Roaming\Python\Python38\site-packages\plyer\platforms\win\filechooser.py", line 108, in run
self._handle_selection(self.selection)
File "C:\Users\Dheeraj\Desktop\kivy codes\Dheeraj.py", line 949, in selected
Directory=selection[0]
IndexError: list index out of range
[INFO ] [Base ] Leaving application in progress...

Screenshots

Add images to explain us this bug. Paste urls here.

Remove this section if no images here

Versions

  • OS: win 7 pro
  • Python: 3.7
  • Kivy: latest
  • KivyMD: latest (update everyweek)

Scoreboards not working

I am trying to use helper for the sidebar scoreboards. I added helper as a dependency in maven and used this:

<dependency>
        <groupId>me.lucko</groupId>
        <artifactId>helper</artifactId>
        <version>5.6.5</version>
        <scope>provided</scope>
    </dependency>

I also added the helper plugin to my server. Downloaded from https://ci.lucko.me/job/helper/lastSuccessfulBuild/artifact/helper/target/helper.jar. I only used the base helper as that is all I need. I also added helper as a depend in my plugin.yml, but even then I still get this error https://bytebin.lucko.me/bQimttSvmd
My server verion:
This server is running CraftBukkit version git-PaperSpigot-"4c7641d" (MC: 1.8.8) (Implementing API version 1.8.8-R0.1-SNAPSHOT)
Does anyone know why, or is this potentially a helper bug.

PacketScoreboard index out of bounds

I've encountered an error when using PacketScoreboardProvider in my code:
Scoreboard scoreboard = Services.load(PacketScoreboardProvider.class).getScoreboard();

It caused an error when I joined the server:
https://hastebin.com/alijexifil.md

Maybe some method that was used is modified in future nms versions? I'm using 1.14.4 latest stable version

Suggestion: Command Cooldowns

Adding cooldowns to the Command Builder would be fantastic. Usage might look like:

.cooldown(30, TimeUnit.SECONDS)
or
.playerCooldown(30, TimeUnit.SECONDS) and .serverCooldown(30, TimeUnit.Seconds)

Implementation might be best based on Guava's CacheBuilder seen here.

Tagging @leonardo-dgs for being the only person who has made a PR in some time and already has some experience working with the Command system.

Bucket doesn't split elements into different partition

When I run it on the server it doesn't return the expected result.
image

image

image

Smaller partition size for clearer demonstration (32 partitions):
image

EDIT: I'm using the main helper module, version 5.6.2, with a standalone plugin (version 5.6.4).

Hocon Configuration

It is completely incomprehensible how to use your api.
How do I serialize/deserialize a class? Class -> Hcon -> Class
How to work with the config node tree?
How to add a node? All I get when I try to directly add a node to the map is
image

helper-redis NoClassDefFoundError: org/slf4j/LoggerFactory

so, I put helper & helper-redis on my server, but helper-redis can't connect to redis because the class org/slf4j/LoggerFactory can't be found which is used by jedis, I have put the same plugins on another server which have a few other plugins and I somehow don't get this issue on there.

[10:58:16 ERROR]: Error occurred while enabling helper-redis v1.2.1 (Is it up to date?)
java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
        at redis.clients.jedis.JedisPool.<clinit>(JedisPool.java:17) ~[?:?]
        at me.lucko.helper.redis.plugin.HelperRedis.<init>(HelperRedis.java:70) ~[?:?]
        at me.lucko.helper.redis.plugin.HelperRedisPlugin.getRedis(HelperRedisPlugin.java:64) ~[?:?]
        at me.lucko.helper.redis.plugin.HelperRedisPlugin.enable(HelperRedisPlugin.java:45) ~[?:?]
        at me.lucko.helper.plugin.ExtendedJavaPlugin.onEnable(ExtendedJavaPlugin.java:100) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321) ~[patched_1.8.8.jar:git-PaperSpigot-445]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:332) [patched_1.8.8.jar:git-PaperSpigot-445]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:407) [patched_1.8.8.jar:git-PaperSpigot-445]
        at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugin(CraftServer.java:359) [patched_1.8.8.jar:git-PaperSpigot-445]
        at org.bukkit.craftbukkit.v1_8_R3.CraftServer.enablePlugins(CraftServer.java:318) [patched_1.8.8.jar:git-PaperSpigot-445]
        at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:203) [patched_1.8.8.jar:git-PaperSpigot-445]
        at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:563) [patched_1.8.8.jar:git-PaperSpigot-445]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_312]
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
        at java.net.URLClassLoader.findClass(URLClassLoader.java:387) ~[?:1.8.0_312]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:102) ~[patched_1.8.8.jar:git-PaperSpigot-445]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:87) ~[patched_1.8.8.jar:git-PaperSpigot-445]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:418) ~[?:1.8.0_312]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[?:1.8.0_312]
        ... 13 more
[10:58:16 INFO]: [helper-redis] Disabling helper-redis v1.2.1

FastClasspathScanner is outdated -- consider porting to ClassGraph

Your project, lucko/helper, depends on the outdated library FastClasspathScanner in the following source files:

FastClasspathScanner has been significantly reworked since the version your code depends upon:

  • a significant number of bugs have been fixed
  • some nontrivial API changes have been made to simplify and unify the API
  • FastClasspathScanner has been renamed to ClassGraph: https://github.com/classgraph/classgraph

ClassGraph is a significantly more robust library than FastClasspathScanner, and is more future-proof. All future development work will be focused on ClassGraph, and FastClasspathScanner will see no future development.

Please consider porting your code over to the new ClassGraph API, particularly if your project is in production or has downstream dependencies:

Feel free to close this bug report if this code is no longer in use. (You were sent this bug report because your project depends upon FastClasspathScanner, and has been starred by 57 users. Apologies if this bug report is not helpful.)

Unable to build project

Unable to build project due to the lack of shadow-bukkit version 1.3-SNAPSHOT on a Maven repo.

FieldAccessException on 1.17

Not sure if this is a helper error or a ProtocolLib error

[19:43:35] [Server thread/WARN]: [ProtocolLib] Loaded class me.lucko.helper.scoreboard.PacketScoreboardTeam from helper v5.6.7 which is not a depend, softdepend or loadbefore of this plugin.
[19:43:35] [Server thread/WARN]: FieldAccessException: No field with type net.minecraft.network.chat.IChatBaseComponent exists in class PacketPlayOutScoreboardTeam.
[19:43:35] [Server thread/WARN]: 	at com.comphenix.protocol.reflect.StructureModifier.writeInternal(StructureModifier.java:365)
[19:43:35] [Server thread/WARN]: 	at com.comphenix.protocol.reflect.StructureModifier.write(StructureModifier.java:345)
[19:43:35] [Server thread/WARN]: 	at me.lucko.helper.scoreboard.PacketScoreboardTeam.newUpdatePacket(PacketScoreboardTeam.java:384)
[19:43:35] [Server thread/WARN]: 	at me.lucko.helper.scoreboard.PacketScoreboardTeam.setColor(PacketScoreboardTeam.java:277)
[19:43:35] [Server thread/WARN]: 	at me.pugabyte.nexus.features.minigames.models.scoreboards.MinigameScoreboard$Teams.lambda$getScoreboardTeam$0(MinigameScoreboard.java:93)
[19:43:35] [Server thread/WARN]: 	at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1224)
[19:43:35] [Server thread/WARN]: 	at me.pugabyte.nexus.features.minigames.models.scoreboards.MinigameScoreboard$Teams.getScoreboardTeam(MinigameScoreboard.java:91)
[19:43:35] [Server thread/WARN]: 	at me.pugabyte.nexus.features.minigames.models.scoreboards.MinigameScoreboard$Teams.lambda$update$2(MinigameScoreboard.java:111)
[19:43:35] [Server thread/WARN]: 	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
[19:43:35] [Server thread/WARN]: 	at me.pugabyte.nexus.features.minigames.models.scoreboards.MinigameScoreboard$Teams.update(MinigameScoreboard.java:104)
[19:43:35] [Server thread/WARN]: 	at me.pugabyte.nexus.features.minigames.models.Match.start(Match.java:232)
[19:43:35] [Server thread/WARN]: 	at me.pugabyte.nexus.features.minigames.models.Lobby$LobbyTimer.lambda$start$1(Lobby.java:103)
[19:43:35] [Server thread/WARN]: 	at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftTask.run(CraftTask.java:100)
[19:43:35] [Server thread/WARN]: 	at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:468)
[19:43:35] [Server thread/WARN]: 	at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1488)
[19:43:35] [Server thread/WARN]: 	at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:477)
[19:43:35] [Server thread/WARN]: 	at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1404)
[19:43:35] [Server thread/WARN]: 	at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1180)
[19:43:35] [Server thread/WARN]: 	at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:320)
[19:43:35] [Server thread/WARN]: 	at java.base/java.lang.Thread.run(Thread.java:831)

HelperPromise Java 17

src\main\java\me\lucko\helper\promise\HelperPromise.java:92: error: method addCallback in class Futures cannot be applied to given types;
            Futures.addCallback(fut, new FutureCallback<U>() {
                   ^
  required: ListenableFuture<V>,FutureCallback<? super V>,Executor
  found:    ListenableFuture<U>,<anonymous FutureCallback<U>>
  reason: cannot infer type-variable(s) V
    (actual and formal argument lists differ in length)
  where V,U are type-variables:
    V extends Object declared in method <V>addCallback(ListenableFuture<V>,FutureCallback<? super V>,Executor)
    U extends Object declared in method <U>wrapFuture(Future<U>)

Jenkins - package me.lucko.scriptcontroller.environment.settings does not exist

Full console output:
https://gist.githubusercontent.com/andrewkm/b7ad1d932a5aa1f211319e89dff840ae/raw/99fd7409fa689023564566de186efee5ab2539ff/gistfile1.txt

We're trying to do some Helper work for 1.13.2 as it's the only thing left for one of our entire gamemodes, that heavily depends on it, to function. My last roadblock is the jenkins issue above, which you've stated you experience as well.

It would be amazing if you could fix this some time for us <3

Error with PaginatedGui

Got this PaginatedGui :

public class TitlesGui extends PaginatedGui {

    private static final MenuScheme DECORATION_SCHEME = new MenuScheme()
            .mask("100000001")
            .mask("100000001")
            .mask("100000001");

    private static final MenuScheme TITLES_SCHEME = new MenuScheme()
            .mask("011111110")
            .mask("011111110")
            .mask("000000000");

    private static final MenuScheme RESET_BUTTON_SCHEME = new MenuScheme()
            .maskEmpty(2)
            .mask("000010000");

    public TitlesGui(Player p) {
        super(paginatedGui -> new ArrayList<>(), p,
                PaginatedGuiBuilder.create().lines(3).title("Mes titres")
                        .itemSlots(TITLES_SCHEME.getMaskedIndexesImmutable())
                        .nextPageSlot(new MenuScheme()
                                .maskEmpty(2)
                                .mask("001000000")
                                .getMaskedIndexes().get(0))
                        .previousPageSlot(new MenuScheme()
                                .maskEmpty(2)
                                .mask("000000100")
                                .getMaskedIndexes().get(0))
                        .nextPageItem(pageInfo -> ItemStackBuilder.of(Material.ARROW)
                                .name("&6Page suivante")
                                .build())
                        .previousPageItem(pageInfo -> ItemStackBuilder.of(Material.ARROW)
                                .name("&6Page précédente")
                                .build())
        );
        updateContent(getTitles());
    }

    public List<Item> getTitles() {
        List<Item> content = new ArrayList<>();
        for (Title title : VikicraftTitles.getTitles()) {
            if (!VikicraftTitles.hasUnlocked(getPlayer(), title)) continue;

            ItemStackBuilder itemStack = title.buildItem();

            if (title.equals(VikicraftTitles.getTitle(getPlayer()))) {
                itemStack.enchant(Enchantment.LUCK);
                itemStack.flag(ItemFlag.HIDE_ENCHANTS);
            }

            Item item = Item.builder(itemStack.build()).bind(ClickType.LEFT, () -> {
                VikicraftTitles.setTitle(getPlayer(), title);
                Players.msg(getPlayer(), "&aTon titre a été changé en "+title.getTag());
                updateContent(getTitles());
                redraw();
            }).build();

            content.add(item);
        }

        return content;
    }

    @Override
    public void redraw() {
        super.redraw();

        if (isFirstDraw()) {
            // decoration
            DECORATION_SCHEME.newPopulator(this)
                    .acceptIfSpace(ItemStackBuilder.of(Material.STAINED_GLASS_PANE).buildItem().build());

            // reset button
            Item resetButton = Item.builder(
                    ItemStackBuilder.of(Material.BARRIER)
                            .name("&cRetirer mon titre")
                            .build()
            ).bind(ClickType.LEFT, () -> {
                VikicraftTitles.setTitle(getPlayer(), null);
                Players.msg(getPlayer(), "&aTon titre a été retiré.");
                updateContent(getTitles());
                redraw();
            }).build();

            RESET_BUTTON_SCHEME.newPopulator(this)
                    .acceptIfSpace(resetButton);
        }
    }

}

It gives me this error, tried to fix it but it seems it's helper's side :

[13:12:17 WARN]: java.lang.IllegalArgumentException: Invalid slot id: 27
[13:12:17 WARN]:        at me.lucko.helper.menu.Gui.getSlot(Gui.java:167)
[13:12:17 WARN]:        at me.lucko.helper.menu.Gui.setItem(Gui.java:174)
[13:12:17 WARN]:        at me.lucko.helper.menu.scheme.MenuScheme.lambda$apply$0(MenuScheme.java:142)
[13:12:17 WARN]:        at java.util.Optional.ifPresent(Optional.java:159)
[13:12:17 WARN]:        at me.lucko.helper.menu.scheme.MenuScheme.apply(MenuScheme.java:142)
[13:12:17 WARN]:        at me.lucko.helper.menu.paginated.PaginatedGui.redraw(PaginatedGui.java:80)
[13:12:17 WARN]:        at net.vikicraft.titles.gui.TitlesGui.redraw(TitlesGui.java:84)
[13:12:17 WARN]:        at me.lucko.helper.menu.Gui.open(Gui.java:256)
[13:12:17 WARN]:        at net.vikicraft.titles.VikicraftTitles.lambda$enable$0(VikicraftTitles.java:67)
[13:12:17 WARN]:        at me.lucko.helper.command.functional.FunctionalCommand.call(FunctionalCommand.java:58)
[13:12:17 WARN]:        at me.lucko.helper.command.AbstractCommand.onCommand(AbstractCommand.java:57)
[13:12:17 WARN]:        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44)
[13:12:17 WARN]:        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:152)
[13:12:17 WARN]:        at org.bukkit.craftbukkit.v1_12_R1.CraftServer.dispatchCommand(CraftServer.java:685)
[13:12:17 WARN]:        at net.minecraft.server.v1_12_R1.PlayerConnection.handleCommand(PlayerConnection.java:1492)
[13:12:17 WARN]:        at net.minecraft.server.v1_12_R1.PlayerConnection.a(PlayerConnection.java:1297)
[13:12:17 WARN]:        at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(PacketPlayInChat.java:45)
[13:12:17 WARN]:        at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(PacketPlayInChat.java:5)
[13:12:17 WARN]:        at net.minecraft.server.v1_12_R1.PlayerConnectionUtils.lambda$ensureMainThread$0(PlayerConnectionUtils.java:14)
[13:12:17 WARN]:        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[13:12:17 WARN]:        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[13:12:17 WARN]:        at net.minecraft.server.v1_12_R1.SystemUtils.a(SourceFile:46)
[13:12:17 WARN]:        at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:850)
[13:12:17 WARN]:        at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:423)
[13:12:17 WARN]:        at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:774)
[13:12:17 WARN]:        at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:666)
[13:12:17 WARN]:        at java.lang.Thread.run(Thread.java:748)

Need help with configs.

For example I have 2 files: lang.yml and config.yml. How to get teamName field from lang.yml and set the delay value to 40 in the config.yml?

Suggestion: Ability to serialize Gui class (or an extended class)

For persistence and ease of end-user modification (of titles and menu schemes, for example).

This might also include Item serialization. I'm aware the backing ItemStack is serializable, but it is done in such a way which is not user-friendly (version numbering, dirty metadata, et al.). It's possible that #84 may need to be resolved before this can be attempted.

Suggestion: tab handler for subcommands

It would be useful to have the possibility to set a tab completer handler (to tab-complete subcommands) like how can be registered the command handler with FunctionalCommandBuilder#handler.

No API implementation set (UPC and UltraBackPacks)

[Server thread/ERROR]: [helper] Exception occurred in a helper event handler for org.bukkit.event.block.BlockBreakEvent
me.lucko.helper.internal.exception.types.EventHandlerException: Exception occurred in a helper event handler for org.bukkit.event.block.BlockBreakEvent
at me.lucko.helper.internal.exception.HelperExceptions.reportEvent(HelperExceptions.java:72) ~[helper.jar:?]
at me.lucko.helper.event.functional.single.HelperEventListener.execute(HelperEventListener.java:142) ~[helper.jar:?]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:git-Paper-388]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:669) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at net.minecraft.server.level.ServerPlayerGameMode.destroyBlock(ServerPlayerGameMode.java:412) ~[?:?]
at net.minecraft.server.level.ServerPlayerGameMode.destroyAndAck(ServerPlayerGameMode.java:366) ~[?:?]
at net.minecraft.server.level.ServerPlayerGameMode.handleBlockBreakAction(ServerPlayerGameMode.java:299) ~[?:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl.handlePlayerAction(ServerGamePacketListenerImpl.java:1770) ~[?:?]
at net.minecraft.network.protocol.game.ServerboundPlayerActionPacket.handle(ServerboundPlayerActionPacket.java:34) ~[?:?]
at net.minecraft.network.protocol.game.ServerboundPlayerActionPacket.a(ServerboundPlayerActionPacket.java:14) ~[?:?]
at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$1(PacketUtils.java:51) ~[?:?]
at net.minecraft.server.TickTask.run(TickTask.java:18) ~[paper-1.18.2.jar:git-Paper-388]
at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:153) ~[?:?]
at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[?:?]
at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1400) ~[paper-1.18.2.jar:git-Paper-388]
at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:188) ~[paper-1.18.2.jar:git-Paper-388]
at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[?:?]
at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1377) ~[paper-1.18.2.jar:git-Paper-388]
at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1370) ~[paper-1.18.2.jar:git-Paper-388]
at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:136) ~[?:?]
at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1348) ~[paper-1.18.2.jar:git-Paper-388]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1230) ~[paper-1.18.2.jar:git-Paper-388]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316) ~[paper-1.18.2.jar:git-Paper-388]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.IllegalStateException: No API implementation set. Is UltraBackpacks enabled?
at dev.drawethree.ultrabackpacks.api.service.BackendAPI.getImplementation(BackendAPI.java:52) ~[UltraPrisonCore-1.11.3-RELEASE.jar:?]
at dev.drawethree.ultrabackpacks.api.UltraBackpacksAPI.handleBlocksBroken(UltraBackpacksAPI.java:53) ~[UltraPrisonCore-1.11.3-RELEASE.jar:?]
at dev.drawethree.ultraprisoncore.enchants.enchants.implementations.LayerEnchant.onBlockBreak(LayerEnchant.java:118) ~[UltraPrisonCore-1.11.3-RELEASE.jar:?]
at dev.drawethree.ultraprisoncore.enchants.managers.EnchantsManager.handleBlockBreak(EnchantsManager.java:273) ~[UltraPrisonCore-1.11.3-RELEASE.jar:?]
at dev.drawethree.ultraprisoncore.enchants.UltraPrisonEnchants.lambda$registerEvents$17(UltraPrisonEnchants.java:324) ~[UltraPrisonCore-1.11.3-RELEASE.jar:?]
at me.lucko.helper.utils.Delegates$ConsumerToBiConsumerSecond.accept(Delegates.java:150) ~[helper.jar:?]
at me.lucko.helper.event.functional.single.HelperEventListener.execute(HelperEventListener.java:136) ~[helper.jar:?]

Dependencies not shaded correctly.

So when I add helper as a dependency to my gradle, relocations of some dependencies aren't made in some classes. Like in the
ExtendedJavaPlugin class and ConfigFactory for instance.
image
image
Perhaps it's not going to be like that but when looking at one of the dependencies classes like ConfigurationNode, we can see that it is relocated which makes no sense since why would the class come from the original package as you can see in the screenshots if a relocated one is present. I can make a pr but I'd probably change the project from maven to gradle then if that would be okay.

BungeeCord module and different structure

It would be useful to have a BungeeCord module helper-bungee, and have a module with all code that does not rely on any server code like helper-common, and a module helper-bukkit.

PacketHologram can not click

PacketHologram can not click
can not run clickCallback

`
this.hologram=this.hologramFactory.newHologram(Position.of(xx)), lineBuilder.build());

hologram.setClickCallback((p) -> {
update();
});
hologram.spawn();
hologram.addViewer(player);
`

ProtocolLib: 4.5.1
Minecraft Client Version: 1.8.9
Server Version: 1.8.8 Spigot
helper plugin version: latest

Disable a TerminableModule

Would it be possible to disable TerminableModule's bound with bindModule() form an ExtendedJavaPlugin ?

SignPrompt - ProtocolLib issue

Using latest protocollib.
Server version spigot 1.8.8

24.03 04:27:10 [Server] ERROR [helper] [EVENTS] Exception thrown whilst handling event: com.comphenix.protocol.events.PacketEvent
24.03 04:27:10 [Server] WARN FieldAccessException: No field with type [Ljava.lang.String; exists in class PacketPlayInUpdateSign.
24.03 04:27:10 [Server] WARN at com.comphenix.protocol.reflect.StructureModifier.readInternal(StructureModifier.java:218)
24.03 04:27:10 [Server] WARN at com.comphenix.protocol.reflect.StructureModifier.read(StructureModifier.java:197)
24.03 04:27:10 [Server] WARN at me.lucko.helper.signprompt.PacketSignPromptFactory.lambda$openPrompt$2(PacketSignPromptFactory.java:94)
24.03 04:27:10 [Server] WARN at me.lucko.helper.event.functional.protocol.HelperProtocolListener.onPacket(HelperProtocolListener.java:127)
24.03 04:27:10 [Server] WARN at me.lucko.helper.event.functional.protocol.HelperProtocolListener.onPacketReceiving(HelperProtocolListener.java:81)
24.03 04:27:10 [Server] WARN at com.comphenix.protocol.injector.SortedPacketListenerList.invokeReceivingListener(SortedPacketListenerList.java:114)
24.03 04:27:10 [Server] WARN at com.comphenix.protocol.injector.SortedPacketListenerList.invokePacketRecieving(SortedPacketListenerList.java:67)
24.03 04:27:10 [Server] WARN at com.comphenix.protocol.injector.PacketFilterManager.handlePacket(PacketFilterManager.java:537)
24.03 04:27:10 [Server] WARN at com.comphenix.protocol.injector.PacketFilterManager.invokePacketRecieving(PacketFilterManager.java:509)
24.03 04:27:10 [Server] WARN at com.comphenix.protocol.injector.netty.ProtocolInjector.packetReceived(ProtocolInjector.java:348)
24.03 04:27:10 [Server] WARN at com.comphenix.protocol.injector.netty.ProtocolInjector.onPacketReceiving(ProtocolInjector.java:313)
24.03 04:27:10 [Server] WARN at com.comphenix.protocol.injector.netty.ChannelInjector.decode(ChannelInjector.java:594)
24.03 04:27:10 [Server] WARN at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:249)
24.03 04:27:10 [Server] WARN at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:149)
24.03 04:27:10 [Server] WARN at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)
24.03 04:27:10 [Server] WARN at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)
24.03 04:27:10 [Server] WARN at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:163)
24.03 04:27:10 [Server] WARN at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)
24.03 04:27:10 [Server] WARN at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)
24.03 04:27:10 [Server] WARN at com.comphenix.protocol.injector.netty.ChannelInjector$2.channelRead(ChannelInjector.java:290)
24.03 04:27:10 [Server] WARN at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)
24.03 04:27:10 [Server] WARN at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)
24.03 04:27:10 [Server] WARN at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:163)
24.03 04:27:10 [Server] WARN at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)
24.03 04:27:10 [Server] WARN at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)
24.03 04:27:10 [Server] WARN at io.netty.handler.timeout.ReadTimeoutHandler.channelRead(ReadTimeoutHandler.java:150)
24.03 04:27:10 [Server] WARN at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)
24.03 04:27:10 [Server] WARN at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)
24.03 04:27:10 [Server] WARN at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787)
24.03 04:27:10 [Server] WARN at io.netty.channel.epoll.EpollSocketChannel$EpollSocketUnsafe.epollInReady(EpollSocketChannel.java:722)
24.03 04:27:10 [Server] WARN at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:326)
24.03 04:27:10 [Server] WARN at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:264)
24.03 04:27:10 [Server] WARN at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)
24.03 04:27:10 [Server] WARN at java.lang.Thread.run(Thread.java:748)

NPE when shutting down helper-redis

Hi,

Getting an NPE from helper-redis when shutting down the server, still happens when nothing is using helper-redis too.

at me.lucko.helper.redis.plugin.HelperRedis$1.run(HelperRedis.java:90) at me.lucko.helper.utils.Delegates$RunnableToSupplier.get(Delegates.java:127) at me.lucko.helper.promise.HelperPromise$SupplyRunnable.run(HelperPromise.java:677) at me.lucko.helper.scheduler.HelperExecutors$SchedulerWrappedRunnable.run(HelperExecutors.java:95) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834) Caused by: java.lang.NullPointerException at java.base/java.lang.String.<init>(String.java:561) at me.lucko.helper.redis.plugin.HelperRedis$PubSubListener.onUnsubscribe(HelperRedis.java:194) at redis.clients.jedis.BinaryJedisPubSub.process(BinaryJedisPubSub.java:100) at redis.clients.jedis.BinaryJedisPubSub.proceedWithPatterns(BinaryJedisPubSub.java:75) at redis.clients.jedis.BinaryJedis.psubscribe(BinaryJedis.java:3349) at me.lucko.helper.redis.plugin.HelperRedis$1.run(HelperRedis.java:87)

IndexOutOfBounds when clicking on Paginated gui's buttons on extremities

https://pastebin.com/pMftVE1Z is spammed in console each time a GUI that is paginated has the forward/back buttons pressed when you're on the limits of the pages (ie, pressing back on page 1, pressing next on the last page.)

Repeatedly clicking on it allows the current page to be past the index, requiring to hit the back buttons multiple times to return to valid pages.
https://pastebin.com/aHGAPHMg

IllegalArgumentException when using a paginated gui

i had an IllegalArgumentException when opening a paginated gui and i think it is caused by this:
Schermafbeelding 2020-08-21 om 14 45 24
As you can see there the material names are not valid. this is in the StandardSchemeMappings class.

Here is the error:
[22:47:54] [Server thread/ERROR]: [PunishmentManager] [EVENTS] Exception thrown whilst handling event: org.bukkit.event.inventory.InventoryClickEvent
[22:47:54] [Server thread/WARN]: java.lang.NoSuchFieldError: STAINED_GLASS_PANE
[22:47:54] [Server thread/WARN]: at me.lucko.helper.menu.scheme.StandardSchemeMappings.(StandardSchemeMappings.java:41)
[22:47:54] [Server thread/WARN]: at me.lucko.helper.menu.scheme.MenuScheme.(MenuScheme.java:52)
[22:47:54] [Server thread/WARN]: at me.lucko.helper.menu.scheme.MenuScheme.(MenuScheme.java:58)
[22:47:54] [Server thread/WARN]: at me.lucko.helper.menu.paginated.PaginatedGuiBuilder.(PaginatedGuiBuilder.java:52)
[22:47:54] [Server thread/WARN]: at me.superbiebel.punishmentmanager.menusystem.menu.ActionsListGUI.lambda$redraw$0(ActionsListGUI.java:46)
[22:47:54] [Server thread/WARN]: at me.lucko.helper.menu.SimpleSlot.handle(SimpleSlot.java:70)
[22:47:54] [Server thread/WARN]: at me.lucko.helper.menu.Gui.lambda$startListening$10(Gui.java:357)
[22:47:54] [Server thread/WARN]: at me.lucko.helper.utils.Delegates$ConsumerToBiConsumerSecond.accept(Delegates.java:147)
[22:47:54] [Server thread/WARN]: at me.lucko.helper.event.functional.single.HelperEventListener.execute(HelperEventListener.java:133)
[22:47:54] [Server thread/WARN]: at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80)
[22:47:54] [Server thread/WARN]: at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70)
[22:47:54] [Server thread/WARN]: at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:607)
[22:47:54] [Server thread/WARN]: at net.minecraft.server.v1_16_R1.PlayerConnection.a(PlayerConnection.java:2423)
[22:47:54] [Server thread/WARN]: at net.minecraft.server.v1_16_R1.PacketPlayInWindowClick.a(SourceFile:32)
[22:47:54] [Server thread/WARN]: at net.minecraft.server.v1_16_R1.PacketPlayInWindowClick.a(SourceFile:10)
[22:47:54] [Server thread/WARN]: at net.minecraft.server.v1_16_R1.PlayerConnectionUtils.lambda$ensureMainThread$1(PlayerConnectionUtils.java:23)
[22:47:54] [Server thread/WARN]: at net.minecraft.server.v1_16_R1.TickTask.run(SourceFile:18)
[22:47:54] [Server thread/WARN]: at net.minecraft.server.v1_16_R1.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:136)
[22:47:54] [Server thread/WARN]: at net.minecraft.server.v1_16_R1.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23)
[22:47:54] [Server thread/WARN]: at net.minecraft.server.v1_16_R1.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:109)
[22:47:54] [Server thread/WARN]: at net.minecraft.server.v1_16_R1.MinecraftServer.aZ(MinecraftServer.java:1137)
[22:47:54] [Server thread/WARN]: at net.minecraft.server.v1_16_R1.MinecraftServer.executeNext(MinecraftServer.java:1130)
[22:47:54] [Server thread/WARN]: at net.minecraft.server.v1_16_R1.IAsyncTaskHandler.executeAll(IAsyncTaskHandler.java:95)
[22:47:54] [Server thread/WARN]: at net.minecraft.server.v1_16_R1.MinecraftServer.a(MinecraftServer.java:1266)
[22:47:54] [Server thread/WARN]: at net.minecraft.server.v1_16_R1.MinecraftServer.v(MinecraftServer.java:1001)
[22:47:54] [Server thread/WARN]: at net.minecraft.server.v1_16_R1.MinecraftServer.lambda$a$0(MinecraftServer.java:177)
[22:47:54] [Server thread/WARN]: at java.base/java.lang.Thread.run(Thread.java:832)

Thread Pool size

Hey, the async option from the Executors doesn't limit the number of threads that can be used in the pool, users have to be very careful when using that to not get an out of memory, a proper usage of it would be to limit the number of threads.

Shared GUI for players

me.lucko.helper.menu.Gui contains a "player" field which is private and used by the class. Add the ability to keep a list of players or tell me the easiest way to open the same inventory for many players without inheriting this class.

wiki issue

Although this isn't an error with the API itself it's an issue using the documentation.
Whenever I click the wiki and attempt to click any of the sub categories the page doesn't change.
Thanks.

(Enhancement) Better event priority system

Here's an example code:

Events.subscribe(PlayerJoinEvent.class)
    .name("listenerA") // Optional, and by adding it you can reference it
    .handler(e -> e.setJoinMessage("A"));

Events.subscribe(PlayerJoinEvent.class)
    .name("listenerB")
    .mustRunAfter("listenerA") // Still: Optional. This will ensure that the event will be handled after listener A
    .mustRunBefore("listenerC") // You get the idea: it will ensure that the event will be handled before listenerB
    .handler(e -> e.setJoinMessage("B"));

Events.enableUnexistingListenerWarning(); // Check the code below

Events.subscribe(PlayerJoinEvent.class)
    .name("listenerC")
    .mustRunBefore("listenerB") // B must run before C, and C also must run before B: conflict. 
    // Throwing an exception with stack to let the developer know what is causing it 
    // (Sometimes it can get really complicated, for example, A must run after B must run after C... and must run after A)
    .mustRunAfter("listenerThatDoesntExist") // If listener doesn't exist and listener has been registered for over
    // <a configurable value> seconds, it will send a warning message to the console to let the developer know they probably
    // mistyped the listener name
    // Well, if it's in production state, developers probably don't want there to be a warning message in user's terminal,
    // that's why there's a function: `enableUnexistingListenerWarning()`, so developer can check if it's development build,
    // and enable it if needed
    .disableListenerNotExistingWarning() // With this, the listener can be not existing, and it won't print a warning message
    // So if listener is going to be registered later, it won't print the message
    .handler(e -> e.setJoinMessage("B"));

You can do it with a topological sorting algorithm, it would help a lot of developers.

(In my previous plugins, event priority gets really complicated and gets more than 5 layers, so in the end, I decided to code my own Event system instead of using an existing one, and having to figure out which priority should it be is very annoying and very hard to refactor. For example: If you want to insert an listener between A and B, you'll have to change everything before A or everything after B, having mustRunAfter and mustRunBefoer makes it way easier, so if plugin developers want to do something like damage processing in order, they can do it without painfully figuring out what priority should it be.)

I know it sounds impossible because Bukkit's event system is really not that great.

The only way I can think of to implement it is to have a custom event system, and have the main listener that listens to every single event, and call listeners.
But I don't really know how you actually listen to every event since there can be custom events, a way would be attaching to the server JVM instance, modifying the bytecode of "callEvent" and adding instructions that call an inner function of this library.

Another way to listen to all events is by using reflection, going through every plugin class loader, and finding every class that extends Event class. It sounds more possible but there can be some limitations like

  1. takes around 1~2 seconds to start the server
  2. Hacks like plugman won't work
    But it's less stupid than attaching into JVM and adding bytecodes, but it will be slower. Probably make 2 of them and make it configurable?

It may sound really stupid, but it will actually help a lot of people trying to develop complicated plugins.

Checksums for LibraryManager

Could you add support for checksums to the MavenLibrary annotation to verify the integrity of the downloaded files? Maybe with the default value of an empty string to ignore it.

Citizens hook "NPE"

I made a plugin using this library and I didn't use any of the NPC features, but during startup I get this error.

[03:00:20 INFO]: [NexEngine] [Hook] Citizens: Success!
[03:00:20 WARN]: java.lang.IllegalArgumentException: Trait name null already registered
[03:00:20 WARN]:        at Citizens.jar//net.citizensnpcs.npc.CitizensTraitFactory.registerTrait(CitizensTraitFactory.java:178)
[03:00:20 WARN]:        at FarmRegeneration-1.0.0.jar//me.byteful.plugin.farmregeneration.lib.lucko.helper.npc.CitizensNpcFactory.registerTrait(CitizensNpcFactory.java:209)
[03:00:20 WARN]:        at FarmRegeneration-1.0.0.jar//me.byteful.plugin.farmregeneration.lib.lucko.helper.npc.CitizensNpcFactory.init(CitizensNpcFactory.java:89)
[03:00:20 WARN]:        at FarmRegeneration-1.0.0.jar//me.byteful.plugin.farmregeneration.lib.lucko.helper.npc.CitizensNpcFactory.lambda$new$1(CitizensNpcFactory.java:81)
[03:00:20 WARN]:        at FarmRegeneration-1.0.0.jar//me.byteful.plugin.farmregeneration.lib.lucko.helper.utils.Delegates$ConsumerToBiConsumerSecond.accept(Delegates.java:150)
[03:00:20 WARN]:        at FarmRegeneration-1.0.0.jar//me.byteful.plugin.farmregeneration.lib.lucko.helper.event.functional.single.HelperEventListener.execute(HelperEventListener.java:136)
[03:00:20 WARN]:        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80)
[03:00:20 WARN]:        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70)
[03:00:20 WARN]:        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:624)
[03:00:20 WARN]:        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:381)
[03:00:20 WARN]:        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:500)
[03:00:20 WARN]:        at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugin(CraftServer.java:535)
[03:00:20 WARN]:        at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugins(CraftServer.java:449)
[03:00:20 WARN]:        at net.minecraft.server.MinecraftServer.loadWorld(MinecraftServer.java:727)
[03:00:20 WARN]:        at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:318)
[03:00:20 WARN]:        at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1216)
[03:00:20 WARN]:        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:321)
[03:00:20 WARN]:        at java.base/java.lang.Thread.run(Thread.java:831)

Seems to happen with any server version compatible with helper so it seems to be a plugin-to-plugin incompatibility. It's most likely "NexEngine" modifying traits in Citizens and then helper attempts to do the same.

InaccessibleObjectException on startup with Java 16

[11:25:38] [Server thread/INFO]: [helper] Loading helper v5.6.7
[11:25:38] [Server thread/INFO]: [helper] helper (me.lucko.helper) bound to plugin helper - me.lucko.helper.internal.StandalonePlugin
[11:25:38] [Server thread/ERROR]: [org.bukkit.craftbukkit.v1_16_R3.CraftServer] null initializing helper v5.6.7 (Is it up to date?)
java.lang.ExceptionInInitializerError: null
        at me.lucko.helper.plugin.ExtendedJavaPlugin.onLoad(ExtendedJavaPlugin.java:78) ~[?:?]
        at org.bukkit.craftbukkit.v1_16_R3.CraftServer.loadPlugins(CraftServer.java:394) ~[patched_1.16.5.jar:git-Paper-629]
        at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:252) ~[patched_1.16.5.jar:git-Paper-629]
        at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1065) ~[patched_1.16.5.jar:git-Paper-629]
        at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:289) ~[patched_1.16.5.jar:git-Paper-629]
        at java.lang.Thread.run(Thread.java:831) [?:?]
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected void java.net.URLClassLoader.addURL(java.net.URL) accessible: module java.base does not "opens java.net" to unnamed module @6f514ac
        at java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:357) ~[?:?]
        at java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297) ~[?:?]
        at java.lang.reflect.Method.checkCanSetAccessible(Method.java:199) ~[?:?]
        at java.lang.reflect.Method.setAccessible(Method.java:193) ~[?:?]
        at me.lucko.helper.maven.LibraryLoader.<clinit>(LibraryLoader.java:51) ~[?:?]
        ... 6 more

Paper 1.16.5 #654
Java 16 (OpenJDK 64-Bit Server VM 16.0.1+9-Ubuntu-120.04) Host: Linux 5.4.0-29-generic (amd64)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.