Unable to use generics peripherals
Naheulf opened this issue ยท 1 comments
Description of the Issue
Unable to use the new generics peripherals. Even with vanilla stuff.
Steps to Reproduce the Issue
- Create a new world (or use a existing one)
- Close the world
- Open /serverconfig/computercraft-server.toml
- Turn "generic_peripherals" to true
- Save change
- Run the world
- Place a computer or a turtle
- Place a chest or furnace above the computer
- Try to wrap/use the chest/furnace as peripheral
Expected Behavior
The chest should appear as generic inventory peripheral.
Actual Behavior
Do nothing. As if there air/dirt block.
- peripheral.names() doesn't list this tile entity.
- peripheral.wrap("top") return nil
- no event was fired when the chest/furnace is placed or removed
Debug Information
- Minecraft 1.15
- CC: Tweaked 1.90.0
- Related to #452
Well, that's very odd. It works perfectly in development but not at all in actual Forge.
Edit/update: I haven't attached a proper debugger yet, so my analysis is pretty limited. Taking a look through visual VM, it looks like the ServiceLoader
isn't picking up anything.
I'm assuming there's some fun class-loading issues here, though I didn't think that in-dev and production Forge's classloading was too different. I'll have another look inside and IDE :).
Edit 2: Ahh, this is probably McModLauncher/modlauncher#39 - I guess we need to move to a non-ServiceLoader
solution.
I think the cleanest thing to do here is a register(Stream<Class<?>>)
method, and then use Forge's annotation magic instead - should allow us to avoid a hard Forge dependency within the core.