CC: Tweaked

CC: Tweaked

57M Downloads

Unable to use generics peripherals

Naheulf opened this issue ยท 1 comments

commented

Description of the Issue

Unable to use the new generics peripherals. Even with vanilla stuff.

Steps to Reproduce the Issue

  1. Create a new world (or use a existing one)
  2. Close the world
  3. Open /serverconfig/computercraft-server.toml
  4. Turn "generic_peripherals" to true
  5. Save change
  6. Run the world
  7. Place a computer or a turtle
  8. Place a chest or furnace above the computer
  9. 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
commented

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.