SquidDev-CC / CCTweaks

Random additions to ComputerCraft (somewhat deprecated, use CC-Tweaked if you're on Minecraft 1.12).
MIT License
12 stars 2 forks source link

[1.8.9] ToolHostPlayer is not registered with Forge's EntityRegistry #112

Closed Aaron1011 closed 7 years ago

Aaron1011 commented 7 years ago

This is causing issues with SpongeForge, which uses entity registration information for things like Aikar's Timings.

SquidDev commented 7 years ago

Are you sure this resolves the issue? It doesn't look like Forge's FakePlayer is registered with EntityRegistry either.

Aaron1011 commented 7 years ago

@SquidDev: While technically FakePlayer should be registered too, we're able to special-case it since we know it will always exist (in Forge). Unregistered mod-added entities, however, prevent us from being able to accurately report details in Timings, without guessing at the mod id.

SquidDev commented 7 years ago

I've pushed a commit which hopefully fixes this, I'm slightly confused though: ToolHostPlayer extends FakePlayer so would it not be caught by the FakePlayer handler? I haven't looked through Sponge/Timing's code in great detail so don't know.

Aaron1011 commented 7 years ago

@SquidDev: The registration is done against the class, so handling the superclass won't catch it. Additionally, it allows us to provide a more specific breakdown in Timings (e.g. grouping entities by the owning mod).