Lib Multipart

Lib Multipart

46.7k Downloads

Client-side `onAdded` called twice when loading world

Kneelawk opened this issue ยท 1 comments

commented

The Issue

Currently AbstractParts' onAdded method is called twice on the client-side when the world is loaded or when ever a MultipartBlockEntity is loaded from NBT.

This seems to be caused by the PartContainer.readInitialRenderData first explicitly invoking its parts' onAdded methods and then calling its own validate method which re-invokes the parts' onAdded methods.

Potential Fix

The simplest fix seems to be just removing the explicit invocations of onAdded from the readInitialRenderData method and letting validate handle onAdded instead.

commented

This is probably low-priority. None of my code depends on the client-side onAdded only being called once and I don't think I've seen any other code depend on it either.