Posted May 5, 20169 yr I know that pre 1.9 you just did worldObj.markBlockForupdate but i just can't find the 1.9 alternative. Thanks in advance, Laseph.
May 5, 20169 yr Use World#notifyBlockUpdate . You can see an example of this here. Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
May 5, 20169 yr Sorry to invade but there is something I never understood: Use World#notifyBlockUpdate . You can see an example of this here. getWorld().notifyBlockUpdate(getPos(), state, state, [u]3[/u]); 3. Where does this come from? I had no idea what to put there when I was needing to sync data, so I put Integer.MAX_VALUE.
May 5, 20169 yr getWorld().notifyBlockUpdate(getPos(), state, state, [u]3[/u]); 3. Where does this come from? I had no idea what to put there when I was needing to sync data, so I put Integer.MAX_VALUE. Vanilla mostly uses 3 but it looks like the only place the argument is actually used is in RenderGlobal#notifyBlockUpdate , which only checks if (flags & != 0 . This is false for 3, but true for Integer.MAX_VALUE . I don't fully understand the rendering code, but it looks like this value controls whether the RenderChunk updates now ( true ) or later ( false ). Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
May 5, 20169 yr From World#getBlockState : /** * Sets the block state at a given location. Flag 1 will cause a block update. Flag 2 will send the change to * clients (you almost always want this). Flag 4 prevents the block from being re-rendered, if this is a client * world. Flags can be added together. */ 3 means it uses flags 1 and 2, so using flag 3 will cause a block update and send the changes to the client. Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support. 1.12 -> 1.13 primer by williewillus. 1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support. http://www.howoldisminecraft1710.today/
May 5, 20169 yr Those are the flags for World#setBlockState . Vanilla seems to use the same values for World#notifyBlockUpdate ; but as I pointed out, only RenderManager (the client-side IWorldEventListener ) checks if flag 8 is set. PathWorldListener (the common IWorldEventListener ) and WorldManager (the server-side IWorldEventListener ) ignore the flags completely. Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
May 5, 20169 yr You're right, totally missed that. Would that be the only place flag 8 is ever checked? I haven't seen it been used anywhere else. As for the flags I posted, World#getBlockState it's the only place in World with flag descriptions. Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support. 1.12 -> 1.13 primer by williewillus. 1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support. http://www.howoldisminecraft1710.today/
May 5, 20169 yr You're right, totally missed that. Would that be the only place flag 8 is ever checked? I haven't seen it been used anywhere else. That is the only place flag 8 is checked, yes. World#markAndNotifyBlock is the only other place that checks flags and it only checks flags 1, 2 and 4. Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.