Jade_Knightblazer Posted October 31, 2012 Posted October 31, 2012 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 @_@ Quote http://i715.photobucket.com/albums/ww155/JadeKnightblazer/AsgardShieldBannermain.png[/img]
keepcalm Posted October 31, 2012 Posted October 31, 2012 Does par1World.notifyBlockChange work? Quote Protip: try and find answers yourself before asking on the forum. It's pretty likely that there is an answer. Was I helpful? Give me a thank you! http://bit.ly/HZ03zy[/img] Tired of waiting for mods to port to bukkit? use BukkitForge! (now with a working version of WorldEdit!)
SanAndreaP Posted October 31, 2012 Posted October 31, 2012 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. Quote 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.
Jade_Knightblazer Posted October 31, 2012 Author Posted October 31, 2012 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 Quote http://i715.photobucket.com/albums/ww155/JadeKnightblazer/AsgardShieldBannermain.png[/img]
SanAndreaP Posted October 31, 2012 Posted October 31, 2012 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? Quote 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.
Jade_Knightblazer Posted November 3, 2012 Author Posted November 3, 2012 I used your par1World.markBlockNeedsUpdate(par2, par3, par4); Ones that I tried using prior were: world.setBlock update ones and world.mark dirty ones. Quote http://i715.photobucket.com/albums/ww155/JadeKnightblazer/AsgardShieldBannermain.png[/img]
Recommended Posts
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.