Jump to content

Recommended Posts

Posted

Having a rough time trying to get the client to sync up with the server, which using the updateTick Method.

 

Here is the code I use:

    public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
    {
    	int metadata = par1World.getBlockMetadata(par2, par3, par4);
    	boolean powered = par1World.isBlockIndirectlyGettingPowered(par2, par3, par4);
    	
    	if (metadata >= 2 && powered == true)
    	{
    		par1World.setBlockMetadataWithNotify(par2, par3, par4, metadata - 1);
    		metadata = par1World.getBlockMetadata(par2, par3, par4);
    	}
    }

 

This works wonderful as the block does slowely lower in Meta, however the client never sync up with the server. Meaning... The player has to log off and log back in for the Block to be updated :(

 

Not sure how to sync client with Servers block @_@

Posted

I had this problem with my block, too. Maybe this will work (at least it works for me):

par1World.markBlockNeedsUpdate(par2, par3, par4);

 

after setting your metadata.

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Posted

Thank you so much, that method worked like a charm!! Kinda sad tho.... I tired all the other update methods besides that one I guess T_T

 

Works like a charm now :)

 

I'm glad that it works now. But I'm curious which method you used?

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.