Arqade Asked by RunasSudo on March 5, 2021
So, I know that redstone torches burn out, and according to the Minecraft wiki, there is some maths behind this. Unfortunately, the MC wiki isn’t very descriptive (and mixes redstone ticks with game ticks), and I want to know this:
If you use “ticks” in your answer, please say whether you’re talking about redstone ticks or game ticks, otherwise it’ll get really confusing…
A redstone torch will burn out if it pulses (on then off) 8 times in 100 game ticks (5 seconds)
The torch will come on again if it receives an update from either a block or a random game tick (which occur approximately every 30 seconds). However, you must wait until there have been less than 7 pulses in the last 100 game ticks before it can be turned on again.
Correct answer by Ronan on March 5, 2021
In current versions, a redstone torch will burn out if it toggles state 8 times in 60 game ticks (3 seconds). According to the Minecraft Wiki, this change from 100 game ticks was implemented in version 1.2.1 (making the accepted answer incorrect when it was posted).
Here is the relevant code from 1.16.4:
private static boolean isBurnedOut(World world, BlockPos worldIn, boolean pos) {
List<RedstoneTorchBlock.Toggle> list = BURNED_TORCHES.computeIfAbsent(world, (reader) -> {
return Lists.newArrayList();
});
if (pos) {
list.add(new RedstoneTorchBlock.Toggle(worldIn.toImmutable(), world.getGameTime()));
}
int i = 0;
for(int j = 0; j < list.size(); ++j) {
RedstoneTorchBlock.Toggle redstonetorchblock$toggle = list.get(j);
if (redstonetorchblock$toggle.pos.equals(worldIn)) {
++i;
if (i >= 8) {
return true;
}
}
}
return false;
}
public void tick(BlockState state, ServerWorld worldIn, BlockPos pos, Random rand) {
boolean flag = this.shouldBeOff(worldIn, pos, state);
List<RedstoneTorchBlock.Toggle> list = BURNED_TORCHES.get(worldIn);
while(list != null && !list.isEmpty() && worldIn.getGameTime() - (list.get(0)).time > 60L) {
list.remove(0);
}
Answered by qwr on March 5, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP