Closed asiekierka closed 6 years ago
Would this be the correct way to handle these methods? https://github.com/therealfarfetchd/MCMultiPart/commit/8c2f076f30d0887afe8d798ff0224e0d1380bd12
No. markAndNotifyBlock needs to call all of them, and notifyBlockUpdate only the ones traditionally handled by IWorldEventListeners. getActualWorld() will not backtrack!
Huh? World's markAndNotifyBlock works the same way with it calling notifyBlockUpdate, I copied that if block straight from World. Other than that, vanilla World.markAndNotifyBlock specifically only handles flags 1 and 16 itself. I did notice that the condition for flag 16 was inverted though, that needs to be fixed
Only IWorldEventListener I could find that did anything with the flags was RenderGlobal, and that only handles flag 8, which isn't handled at all in MCMP's code. Should I handle every flag in markAndNotifyBlock then?
Huh? World's markAndNotifyBlock works the same way with it calling notifyBlockUpdate, I copied that if block straight from World. Other than that, vanilla World.markAndNotifyBlock specifically only handles flags 1 and 16 itself. I did notice that the condition for flag 16 was inverted though, that needs to be fixed
Yes, but the ActualWorld's markAndNotifyBlock will call the ActualWorld's notifyBlockUpdate, which won't then handle the multipart stuff.
But I'm also calling the wrapped world's notifyBlockUpdate under the same conditions that the actual world's notifyBlockUpdate will get called in markAndNotifyBlock, so the multipart stuff is already handled. Right? I feel like I'm missing something here, haha
notifyBlockUpdate(pos, iblockstate, newState, flags);
okay, i'm stupid
HOWEVER! This will cause getActualWorld().notifyBlockUpdate() to be called twice. Not as bad, but could still impact performance a little
HOWEVER! This will cause getActualWorld().notifyBlockUpdate() to be called twice. Not as bad, but could still impact performance a little
do not forget
yeah, the last commit should fix that.
Aha! Seems like it. Thanks!
I'll push a release before going to bed :)
Only flag values 2 and 4 should be handled in notifyBlockUpdate; flag values 1 and 16 should be handled in markAndNotifyBlock.