Hunter19823 / kubejsadditions

Additions for KubeJS
Other
7 stars 6 forks source link

Update WailaCommonRegistrationEventJS.java #7

Closed Klisz closed 4 months ago

Klisz commented 4 months ago

Allow registering BlockDataProviders from classes that don't extend BlockEntity, as is the case within Jade itself (thus allowing data providers for blocks that don't have blockentities).

Hunter19823 commented 4 months ago

I'm not sure where you saw that Jade itself doesn't need a class that extends Blockentity. This is the version I was basing this API off of, and the interface directly requires it to be a BlockEntity Class and not just any class.

https://github.com/Snownee/Jade/blob/e3abf457453ea62e2f493247ba129b14213bf653/src/main/java/snownee/jade/api/IWailaCommonRegistration.java#L14-L20

        /**
     * Register an {@link IServerDataProvider<BlockAccessor>} instance for data syncing purposes.
     *
     * @param dataProvider The data provider instance
     * @param block        The highest level class to apply to
     */
    void registerBlockDataProvider(IServerDataProvider<BlockAccessor> dataProvider, Class<? extends BlockEntity> block);
Klisz commented 4 months ago

Ah, my bad, I failed to notice that accepting any class was from a very recent PR to Jade and not in the release version yet.