This is perhaps to do with the for loop in the execute() method failing to break when the blockState has already been grown.
public class DoormatCommands {
[...]
public static class RandomTickCommand {
public static int execute(ServerCommandSource source, BlockPos pos, int count) throws CommandSyntaxException {
ServerWorld world = source.getWorld();
BlockState state = world.getBlockState(pos);
Random random = world.getRandom();
if (state.hasRandomTicks()) {
for (int i = 0; i < count; i++)
state.randomTick(world, pos, random);
source.sendFeedback(() -> Text.translatable("carpet.command.randomTick.success", count, pos.getX(), pos.getY(), pos.getZ()), true);
return 1;
}
else throw new SimpleCommandExceptionType(Text.translatable("carpet.command.randomTick.failed")).create();
}
}
}
Noted behaviour:
"Small" saplings like oak, birch and cherry grow multiple times in the same tick, creating huge, blobby trees of their respective types.
2x2 spruce and jungle trees grow one large variant and multiple small variants centred on the target sapling.
Expected behavior:
Saplings all grow with /randomtick the same way they would if they were fertilised with bonemeal.
To reproduce:
Enable /randomtick via /carpet commandRandomTick true
Place down a sapling
Point your crosshair at it, and begin typing /randomtick , autocompleting the block coordinates
Type 4096 as the parameter, enter, and use the ^ key to retype this command again
On this attempt, the sapling should be obnoxious-ified
this issue is fixable by putting the pos and count values to a list/map, and iterating through them in the server tick method. commands seem to run on a different thread or something, leading to a weird disparity
This is perhaps to do with the for loop in the execute() method failing to break when the blockState has already been grown.
Noted behaviour:
Expected behavior:
To reproduce: