Posted July 15, 201510 yr Hello everybody! After working on some time related mechanics, i ran into question: how often block.updateTick is normally called? It's for sure not every tick, that's what are my results for now... Thanks for help! If you have any questions - just ask! Check out my mods: BTAM Armor sets Avoid Exploding Creepers Tools compressor Anti Id Conflict Key bindings overhaul Colourfull blocks Invisi Zones
July 15, 201510 yr It can be every tick, but normally it's not called at all unless you specifically schedule an update tick (which you could do every single tick). For blocks that are set to tick randomly, it is called somewhat regularly based on the tick rate you return from tickRate(World). http://i.imgur.com/NdrFdld.png[/img]
July 15, 201510 yr Author It can be every tick, but normally it's not called at all unless you specifically schedule an update tick (which you could do every single tick). For blocks that are set to tick randomly, it is called somewhat regularly based on the tick rate you return from tickRate(World). So basically, if it returns 10 it means each 10th tick? Or each tick with 1 chance out of 10? Thanks so much! Check out my mods: BTAM Armor sets Avoid Exploding Creepers Tools compressor Anti Id Conflict Key bindings overhaul Colourfull blocks Invisi Zones
July 15, 201510 yr Author based on the tick rate you return from tickRate(World). This is not true. You cannot specify the tick rate for random ticks. The tickRate method does nothing. Apearently, yes. Going though call hierarchy of tickRate showed only BlockStairs and only BlockStairs. Then how often/with which chance is updateTick called? Check out my mods: BTAM Armor sets Avoid Exploding Creepers Tools compressor Anti Id Conflict Key bindings overhaul Colourfull blocks Invisi Zones
July 15, 201510 yr Author If you do nothing it is not called at all. If you do setTickRandomly(true) it will be called randomly, see the Minecraft Wiki for details. If you call world.scheduleBlockUpdate it will be called as many ticks later as you specified there. So basically each block has one chance out of 1365 to be ticked. That's interesting... Check out my mods: BTAM Armor sets Avoid Exploding Creepers Tools compressor Anti Id Conflict Key bindings overhaul Colourfull blocks Invisi Zones
July 16, 201510 yr based on the tick rate you return from tickRate(World). This is not true. You cannot specify the tick rate for random ticks. The tickRate method does nothing. Are you sure? When I tested it out before, it definitely seemed to affect how often the updateTick method was called, but that was way back in 1.6.4, of which my memory is a bit foggy, so... Hm, yeah it seems tickRate isn't really used anywhere other than (in 1. for trip wire hooks which use it when scheduling a block update, and in Forge's BlockFluidFinite class. In 1.7.10, it's only used for stairs, and not really even there because it just returns a different block's tick rate. Really makes one wonder sometimes, doesn't it? It's probably legacy code that Mojang just hasn't gotten around to removing (I hope). http://i.imgur.com/NdrFdld.png[/img]
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.