Ok, I've set up something that resembles a proper repo now, same link.
Even if i make loadColor method always return let's say red it still renders the bed white after reolading.
That's why i suspect it to be a sync issue, as destroy particles have the correct texture, as if getActualState was called on breaking the block but not on choosing a model for it.
I'm trying to further investigate the loadColor right now.
Replacing code in getActualState to make it always return a let's say red as color property makes the bed be still white but always have red destruction particles.
Is there any way for me to pass the state from TE to the block before it's rendered (I was convinced getActualState already did it)?
///Edit///
~~I managed to get the color of bed loaded last( I'm not entirely sure)(so still not the desired one, particles and drops match the desired one) of TE to be the color of the block until the game is restarted, after which it gets back ot block default (white). Even after game restart item drops and particles are correct, so I'd assume TE saves and reads the data correctly.
Im as confused as it gets
(code added to TE)
@Override
public void onLoad()
{
Block bed = getWorld().getBlockState(getPos()).getBlock();
BlockFancyBed fbed = (BlockFancyBed) bed;
fbed.setRenderState(fbed.getActualState(getWorld().getBlockState(getPos()), getWorld(), getPos()));
notifyBlockUpdate();
}
(code added to Block)
public void setRenderState(IBlockState state) {
this.setDefaultState(state);
}
~~ doesn't work anymore for some reason
///Edit2///
Woking with debugger confirms that getActualState is called after interacting with block and not on rendering it, so thats why clolor stays default.
So the question is how to change the state of a single block before it's rendered
(defaulst state and actual state don't seem to cut it)
///Edit3///
i played around with setBlockState in onLoad method of the TE and discovered it gets seemingly called twice per TE, once by Server (color values from debugger seem fine here) and second time by the client Thread (with either null or default color value declared in the TE class)
///Edit4///
Even if I don't get to solve it just yet, thank You for giving me great leads, I have learned a lot.